【问题标题】:Nodejs Telegram bot message receives polling errorNodejs Telegram bot 消息收到轮询错误
【发布时间】:2020-04-07 13:01:02
【问题描述】:

我正在使用

节点模块

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

错误

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

我的代码

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 );
});

任何帮助或建议将不胜感激。

【问题讨论】:

  • 我认为你的令牌格式错误
  • 是的@Sean。我得到了那个错误。感谢您指出。

标签: node.js telegram telegram-bot


【解决方案1】:

尝试禁用或更改为您的其他 Telegram 代理。

您还可以在此处查看其他信息: https://github.com/yagop/node-telegram-bot-api/issues/562#issuecomment-382313307

【讨论】:

    猜你喜欢
    • 2018-07-25
    • 2020-11-23
    • 1970-01-01
    • 2017-05-13
    • 1970-01-01
    • 1970-01-01
    • 2017-08-07
    • 2020-07-03
    • 1970-01-01
    相关资源
    最近更新 更多