update
This commit is contained in:
parent
71a69c5f9b
commit
dd607e15c4
13
data/group/commands.js
Normal file
13
data/group/commands.js
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
const commands = [
|
||||||
|
{
|
||||||
|
"NAME": "/help",
|
||||||
|
"TEXT": [
|
||||||
|
"Hello " + userMention + " please PM me @" + process.env.BOT_USERNAME + " and i'll try to help.",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
module.exports = commands;
|
||||||
|
|
||||||
|
|
||||||
|
|
5
test.js
5
test.js
@ -5,6 +5,7 @@ const token = process.env.BOT_TOKEN;
|
|||||||
const bot = new TelegramBot(token, { polling: true });
|
const bot = new TelegramBot(token, { polling: true });
|
||||||
|
|
||||||
function t(msg, input) {
|
function t(msg, input) {
|
||||||
|
let commands = require('./data/group/commands')
|
||||||
bot.sendMessage(msg.chat.id, input)
|
bot.sendMessage(msg.chat.id, input)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -14,7 +15,7 @@ bot.on('message', (msg) => {
|
|||||||
t(msg, "/sub_status")
|
t(msg, "/sub_status")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg.text && msg.text.toString().includes("/test")) {
|
if (msg.text && msg.text.toString().includes("/help")) {
|
||||||
t(msg, "/test")
|
t(msg, "/help")
|
||||||
}
|
}
|
||||||
})
|
})
|
Loading…
x
Reference in New Issue
Block a user