42 lines
1.6 KiB
JavaScript
42 lines
1.6 KiB
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')
|
|
}
|
|
}
|
|
},
|
|
chat: 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
|
|
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": m
|
|
}
|
|
})
|
|
}
|
|
decache('../../group/commands');
|
|
commands = require('../../group/commands')
|
|
}
|
|
}
|
|
}
|
|
}; |