BBLBTV_Suzie/data/bot/lib/common.js
2020-06-29 22:43:41 +01:00

20 lines
727 B
JavaScript

const decache = require('decache');
module.exports = {
commands: async (bot, msg, input) => {
const userMention = "<a href=\"tg:\/\/user?id=" + msg.from.id + "\">@" + 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')
}
}
}
};