on-internet
โ† Community

pyTelegramBotAPI: set_message_reaction() - How do I make my Telegram bot react with a specific emoji to any message it recieves?

Stack Overflow ยท

This is my code: import telebot BOT_TOKEN = '-' bot = telebot.TeleBot(BOT_TOKEN) @bot.message_handler(func=lambda message:True) def thumbs_up(message): bot.set_message_reaction(message.chat.id, message.id, '๐Ÿ‘') if __name__ == '__main__': bot.polling() And this is the error I get: payload['reaction'] = json.dumps([r.to_dict() for r in reaction]) ^^^^^^^^^ AttributeError: 'str' object has no attribute 'to_dict' I don't understand how I can use a JSON list like the docs say: https://pytba.readthedocs.io/en/latest/sync_version/index.html#telebot.TeleBot.set_message_reaction https://core.telegram.o

Comments

Sign in or sign up to comment and upvote.

No comments yet.