Facebook
From chat/simsimi-bn, 8 Months ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 479
  1. const axios = require('axios');
  2.  
  3. module.exports.config = {
  4.  name: "delete",
  5.  version: "1.0.0",
  6.  hasPermssion: 0,
  7.  credits: "JARiF",
  8.  description: "Delete a question",
  9.  commandCategory: "admin",
  10.  usages: "[name]",
  11.  cooldowns: 3
  12. };
  13.  
  14. module.exports.run = async function({ api, event, args }) {
  15.  const { threadID, messageID } = event;
  16.  const question = args.join(" ");
  17.  
  18.  if (!question) {
  19.    return api.sendMessage("Provide a question to delete.", threadID, messageID);
  20.  }
  21.  
  22.  try {
  23.    const res = await axios.get(
  24.   `https://simsimibn.syntax-team-co.repl.co/delete?ques=${encodeURIComponent(question)}`
  25.    );
  26.    api.sendMessage("Question deleted successfully.", threadID, messageID);
  27.  } catch (error) {
  28.    console.log(error);
  29.    api.sendMessage("Sorry, Not found in the server or the server is busy.", threadID, messageID);
  30.  }
  31. };
  32.