20 lines
453 B
JavaScript
20 lines
453 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) {
|
||
|
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("/test")) {
|
||
|
t(msg, "/test")
|
||
|
}
|
||
|
})
|