I’m working with the node-telegram-bot-api library and trying to add reactions to messages in a channel. When I call the setMessageReaction function, I keep getting this error:
ETELEGRAM: 400 Bad Request: message to react not found
Here’s the code I’m using:
telegramBot.setMessageReaction('@my_channel', msg_id, [
{type: 'emoji', emoji: '👎' },
])
I’ve double checked that the message ID is valid and exists in the channel. The bot has admin permissions in the channel too. Has anyone else run into this issue? What might be causing this error even when the message ID seems correct?
Same thing happened to me. Check your chat ID format - sometimes @channel_name doesn’t work but the numeric ID does. Try getting the chat ID first with getChat('@my_channel') then use that number instead of the @ format. Also double-check that reactions are enabled for the channel - some have them turned off in settings.
I ran into this exact problem! The message ID you’re using is probably the local one, not the actual Telegram message ID. When you send/receive messages through the bot API, the message object’s message_id property often differs from what the channel actually recognizes. Log the complete message object first to make sure you’re grabbing the right ID. Also check that you’re using the channel’s username or ID format correctly - the @ symbol can mess things up depending on how the API handles it. One more thing: was the message sent by your bot or another user? That affects reaction permissions even with admin rights.
Had the same frustrating issue a few months back. Turns out it was timing related - I was trying to react to messages right after sending them, but there’s a small delay before Telegram makes the message available for reactions. Adding a setTimeout of just 500ms before calling setMessageReaction fixed it for me. Also check if your bot actually has reaction permissions, not just general admin rights. Some channel owners restrict reaction permissions separately. Try testing with a message that’s been sitting in the channel for a while first to rule out timing issues.