const decache = require('decache');
module.exports = {
commands: async (bot, msg, input) => {
const userMention = "@" + msg.from.first_name + "<\/a> "
let commands = require('../../group/commands')
for (const x of commands) {
if (x.NAME === input) {
let n = x.NAME
let t = x.TEXT
for (const m of t) {
let a = userMention.concat(m)
await bot.sendMessage(msg.chat.id, a, { parse_mode: "HTML" })
}
decache('../../group/commands');
commands = require('../../group/commands')
}
}
},
chat: async (bot, msg, input) => {
const userMention = "@" + msg.from.first_name + "<\/a> "
let commands = require('../../group/commands')
for (const x of commands) {
if (x.NAME === input) {
let n = x.NAME
let t = x.TEXT
let m = JSON.parse(x.MENU)
for (const m of t) {
let a = userMention.concat(m)
await bot.sendMessage(msg.chat.id, m, {
parse_mode: "HTML",
"reply_markup": {
"keyboard": [[]]
}
})
}
decache('../../group/commands');
commands = require('../../group/commands')
}
}
}
};