21 lines
503 B
JavaScript
21 lines
503 B
JavaScript
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) {
|
|
let commands = require('./data/group/commands')
|
|
bot.sendMessage(msg.chat.id, input)
|
|
}
|
|
|
|
|
|
bot.on('message', (msg) => {
|
|
if (msg.text && msg.text.toString().includes("/sub_status")) {
|
|
t(msg, "/sub_status")
|
|
}
|
|
|
|
if (msg.text && msg.text.toString().includes("/help")) {
|
|
t(msg, "/help")
|
|
}
|
|
}) |