Telegraf.js reaction handler not responding to emoji reactions in Telegram bot

I’m building a Telegram bot using Telegraf.js and having trouble with the reaction listener functionality. When users react to messages with emojis, my bot doesn’t detect or respond to these reactions at all.

Here’s my current setup:

const { Telegraf } = require('telegraf');
const config = require('dotenv');

config.config();
const TOKEN = process.env.TELEGRAM_TOKEN || '';
const telegramBot = new Telegraf(TOKEN);

telegramBot.reaction("❤️", (context) => {
    // should trigger when user adds heart reaction
    console.log("heart reaction detected");
});

telegramBot.launch();
console.log(`Bot started with token: ${TOKEN}`);

My package.json includes:

{
  "dependencies": {
    "telegraf": "^4.16.3",
    "dotenv": "^16.0.3",
    "moment": "^2.29.4"
  }
}

I’ve also attempted using telegramBot.on('message_reaction') and different emoji symbols, but nothing seems to work. The console never shows any output when reactions are added to messages. Has anyone successfully implemented reaction handling with Telegraf? What might I be missing in my configuration?

This happens all the time - your bot isn’t getting reaction updates from Telegram’s servers. Luke’s right about permissions, but you also need to tell your bot to actually listen for these updates. Change your launch method to: telegramBot.launch({ allowedUpdates: ['message', 'message_reaction'] }). Without this, Telegram won’t send reaction events no matter how you set up your handlers. Had the exact same issue last month and this fixed it instantly. Also make sure you’re testing in a regular group chat, not a channel - reactions work differently between the two.

make sure your bot has the right permissions for reactions. go to BotFather and enable the necessary updates. also, try adding the allowed_updates parameter in launch() with message_reaction to get it workin’.

This happens because newer Telegraf versions disable message reaction updates by default. I ran into the same thing building a reaction-based voting system for my community bot. Your code looks fine, but you need to fix the launch config and make sure your bot can actually access reactions in whatever chat you’re testing. Try telegramBot.launch({ allowedUpdates: ['message', 'message_reaction', 'message_reaction_count'] }) and test in a group where your bot has admin rights. Private chats don’t handle message reactions the same way. Also check that your Telegraf version actually supports the reaction method you’re using.