node.js - Nodejs Telegram 机器人消息收到轮询错误

标签 node.js telegram telegram-bot

我正在使用

Node 模块

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

错误

错误:[polling_error] {“code”:“ETELEGRAM”,“message”:“ETELEGRAM:404未找到”

我的代码

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

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

最佳答案

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

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

关于node.js - Nodejs Telegram 机器人消息收到轮询错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51221334/

相关文章:

javascript - 使用 NodeJS 在 RingCentral 中处理 TIFF 附件

node.js - 没有 id 的 PUT 请求

javascript - Telegram Bot API 方法 (getUserProfilePhotos)

telegram - 如何从 Telegram 组下载所有共享媒体文件?

node.js - 我在哪里为node.js设置rejectUnauthorized = false

node.js - 在带有时间戳的 kibana 中没有符合您搜索条件的结果

python - 在 python 中处理 Telegram bot 的多个问题

telegram - 如何使用 Telegram 机器人获取 channel 更新

python - Telethon 问题,需要从 channel 读取消息

telegram-bot - Telegram bot : ChatId ? 没有得到 ChatId 而是 {"ok":true ,"result":[]}