收到错误电子电报:
400 Bad Request: message to react not found
我正在使用 node-telegram-bot API 并尝试通过
setMessageReaction
方法设置对通道中消息的反应:
bot.setMessageReaction method('@channel_name', message_id, [
{type: 'emoji', emoji: '👍' },
])
但是我收到以下错误:
ETELEGRAM: 400 Bad Request: message to react not found
如果消息id正确,可能是什么原因?
您的机器人需要拥有必要的权限才能在目标聊天中添加反应。
const TelegramBot = require('node-telegram-bot-api');
const token = 'YOUR_BOT_TOKEN';
const bot = new TelegramBot(token, { polling: true });
const chatId = 123456789;
const messageId = 123;
const reaction = [{ type: 'emoji', emoji: '👍' }];
bot.setMessageReaction(chatId, messageId, reaction)
.then(() => {
console.log('Reaction added successfully!');
})
.catch(error => {
console.error('Error adding reaction:', error);
});