Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nodejs Telegram bot message receives polling error

I am using

Node Module

https://www.npmjs.com/package/node-telegram-bot-api

error

error: [polling_error] {"code":"ETELEGRAM ","message":"ETELEGRAM : 404 not found"

MyCode

let replyText = "Hi I am Tammy";

const TelegramBot = require('node-telegram-bot-api');
const token = xxxxxxxxx;
                        
const bot = new TelegramBot(token, {polling: true});
                        
bot.onText(/\/echo (.+)/, (msg, match) => {
                      
   const chatId = msg.chat.id;
   const resp = match[1]; // the captured "whatever"
                        
   bot.sendMessage(chatId, resp);
});
                        
bot.on('message', (msg) => {
    const chatId = msg.chat.id;
                        
    bot.sendMessage(chatId, replyText );
});

Any help or suggestion would be thankful.

like image 843
Tammy Avatar asked Mar 14 '26 16:03

Tammy


2 Answers

try disable or change to other your Telegram proxy.

Also you can see additional info here: https://github.com/yagop/node-telegram-bot-api/issues/562#issuecomment-382313307

like image 56
xck Avatar answered Mar 17 '26 05:03

xck


I solved it by removing the "bot" which I added at the beginning of the API_TOKEN.

like image 24
Dawit Abraham Avatar answered Mar 17 '26 06:03

Dawit Abraham



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!