Tammy
Tammy

Reputation: 1132

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.

Upvotes: 3

Views: 14676

Answers (2)

Dawit Abraham
Dawit Abraham

Reputation: 1752

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

Upvotes: 1

m0zgen
m0zgen

Reputation: 563

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

Upvotes: 1

Related Questions