Skip to content

I Got error when starting bot in panel pterodactyl #1267

@danzznhh

Description

@danzznhh

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions