This commit is contained in:
Karl 2020-07-01 18:13:04 +00:00
parent 8c180e9a60
commit d77fc978a0
2 changed files with 4 additions and 2 deletions

4
app.js
View File

@ -62,13 +62,13 @@ bot.on('message', (msg) => {
for (const x of jointArray) {
if (msg.text && msg.text.toString() === x.NAME) {
common.chat(bot, msg, x.NAME)
common.chat(bot, msg, x.NAME, logger)
}
}
for (const x of commands) {
if (msg.text && msg.text.toString().includes(x.NAME)) {
common.commands(bot, msg, x.NAME)
common.commands(bot, msg, x.NAME, logger)
}
}

View File

@ -2,6 +2,7 @@ const decache = require('decache');
module.exports = {
commands: async (bot, msg, input) => {
logger.info("ID - " + msg.from.id + " First Name - " + msg.from.first_name + " did - " + 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) {
@ -18,6 +19,7 @@ module.exports = {
}
},
chat: async (bot, msg, input) => {
logger.info("ID - " + msg.from.id + " First Name - " + msg.from.first_name + " asked - " + input);
const userMention = "<a href=\"tg:\/\/user?id=" + msg.from.id + "\">@" + msg.from.first_name + "<\/a> "
let commands = require('../../group/commands')
let navigation = require('../../group/FAQ')