From 7fe501f19f56f576e17d787edc70191552625a44 Mon Sep 17 00:00:00 2001 From: danielperez9430 Date: Sat, 9 Mar 2024 19:03:58 +0100 Subject: [PATCH] feat: Support for message reaction event --- CHANGELOG.md | 6 ++++++ package.json | 2 +- src/telegram.js | 5 +++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 267767f..ca635de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). + +## [0.65.1][0.65.1] - 2024-03-09 + +1. Support for updates (@danielperez9430) + * message_reaction + ## [0.65.0][0.65.0] - 2024-02-20 1. Support Telegram Bot API v7.1 diff --git a/package.json b/package.json index 8813206..3e4813b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-telegram-bot-api", - "version": "0.65.0", + "version": "0.65.1", "description": "Telegram Bot API", "main": "./index.js", "directories": { diff --git a/src/telegram.js b/src/telegram.js index cc6e223..04ccde4 100644 --- a/src/telegram.js +++ b/src/telegram.js @@ -55,6 +55,7 @@ const _messageTypes = [ 'chat_invite_link', 'chat_member_updated', 'web_app_data', + 'message_reaction' ]; const _deprecatedMessageTypes = [ 'new_chat_participant', 'left_chat_participant' @@ -685,6 +686,7 @@ class TelegramBot extends EventEmitter { const chatMember = update.chat_member; const myChatMember = update.my_chat_member; const chatJoinRequest = update.chat_join_request; + const messageReaction = update.message_reaction; if (message) { debug('Process Update message %j', message); @@ -782,6 +784,9 @@ class TelegramBot extends EventEmitter { } else if (chatJoinRequest) { debug('Process Update my_chat_member %j', chatJoinRequest); this.emit('chat_join_request', chatJoinRequest); + } else if (messageReaction) { + debug('Process Update message_reaction %j', messageReaction); + this.emit('message_reaction', messageReaction); } }