Nodejs Telegram bot消息收到轮询错误

时间:2018-07-07 08:23:45

标签: node.js telegram telegram-bot

我正在使用

节点模块

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

错误

错误:[polling_error] {“代码”:“ ETELEGRAM”,“消息”:“ ETELEGRAM:404未找到”

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

任何帮助或建议都会令人感激。

1 个答案:

答案 0 :(得分:1)

尝试禁用或更改为其他电报代理。

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