【发布时间】: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