-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Description
error: [polling_error] {"code":"EFATAL","message":"EFATAL: AggregateError"}
How to fix it sir?
my simple code
const TelegramBot = require('node-telegram-bot-api');
const token = '###';
const bot = new TelegramBot(token, {
polling: {
interval: 300, // interval polling 300ms
autoStart: true,
params: {
timeout: 10, // timeout 10 detik
},
},
});
bot.onText(//start/, (msg) => {
const chatId = msg.chat.id;
bot.sendMessage(chatId, 'Selamat datang! Saya adalah bot Telegram sederhana.');
});
bot.onText(//halo/, (msg) => {
const chatId = msg.chat.id;
bot.sendMessage(chatId, 'Halo juga!');
});
bot.on('message', (msg) => {
const chatId = msg.chat.id;
if (msg.text === 'halo') {
bot.sendMessage(chatId, 'Halo juga!');
}
});
please help me
Metadata
Metadata
Assignees
Labels
No labels