2020-06-29 21:32:14 +01:00
|
|
|
require('dotenv').config();
|
|
|
|
const TelegramBot = require('node-telegram-bot-api');
|
|
|
|
const token = process.env.BOT_TOKEN;
|
|
|
|
|
|
|
|
const bot = new TelegramBot(token, { polling: true });
|
|
|
|
|
|
|
|
function t(msg, input) {
|
2020-06-29 21:39:15 +01:00
|
|
|
let commands = require('./data/group/commands')
|
2020-06-29 21:32:14 +01:00
|
|
|
bot.sendMessage(msg.chat.id, input)
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bot.on('message', (msg) => {
|
|
|
|
if (msg.text && msg.text.toString().includes("/sub_status")) {
|
|
|
|
t(msg, "/sub_status")
|
|
|
|
}
|
|
|
|
|
2020-06-29 21:39:15 +01:00
|
|
|
if (msg.text && msg.text.toString().includes("/help")) {
|
|
|
|
t(msg, "/help")
|
2020-06-29 21:32:14 +01:00
|
|
|
}
|
|
|
|
})
|