Facebook
From Fatin Rahman Jarif, 8 Months ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 410
  1. const axios = require("axios");
  2.  
  3. module.exports = {
  4.   config: {
  5.     name: "teach",
  6.     version: "1.0",
  7.     author: "JARiF",
  8.     countDown: 5,
  9.     role: 0,
  10.     category: "box chat",
  11.     guide: {
  12.       en: "{p}teach your ask | my answer ",
  13.     },
  14.   },
  15.   onStart: async function ({ api, event, args }) {
  16.     const { messageID, threadID, senderID, body } = event;
  17.     const tid = threadID,
  18.       mid = messageID;
  19.     const content = args.join(" ").split("|").map((item) => item.trim());
  20.     const ask = content[0];
  21.     const ans = content[1];
  22.     if (!args[0])
  23.       return api.sendMessage(
  24.         "Use {p}teach your ask | simsimi-bn respond",
  25.         tid,
  26.         mid
  27.       );
  28.     try {
  29.       const res = await axios.get(
  30.         `https://simsimibn.syntax-team-co.repl.co/teach?ques=${ask}&ans;=${ans}`
  31.       );
  32.       api.sendMessage(
  33.         `Yeaaa! I'm Learned`,
  34.         tid,
  35.         mid
  36.       );
  37.     } catch (error) {
  38.       console.log(error);
  39.       api.sendMessage(
  40.         "Sorry,something went wrong.",
  41.         tid,
  42.         mid
  43.       );
  44.     }
  45.   },
  46. };