2
0
mirror of https://github.com/yagop/node-telegram-bot-api synced 2025-08-29 13:27:44 +00:00

feat: Support for message reaction event

This commit is contained in:
danielperez9430 2024-03-09 19:03:58 +01:00
parent d323a3bac5
commit 7fe501f19f
3 changed files with 12 additions and 1 deletions

View File

@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/). 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 ## [0.65.0][0.65.0] - 2024-02-20
1. Support Telegram Bot API v7.1 1. Support Telegram Bot API v7.1

View File

@ -1,6 +1,6 @@
{ {
"name": "node-telegram-bot-api", "name": "node-telegram-bot-api",
"version": "0.65.0", "version": "0.65.1",
"description": "Telegram Bot API", "description": "Telegram Bot API",
"main": "./index.js", "main": "./index.js",
"directories": { "directories": {

View File

@ -55,6 +55,7 @@ const _messageTypes = [
'chat_invite_link', 'chat_invite_link',
'chat_member_updated', 'chat_member_updated',
'web_app_data', 'web_app_data',
'message_reaction'
]; ];
const _deprecatedMessageTypes = [ const _deprecatedMessageTypes = [
'new_chat_participant', 'left_chat_participant' 'new_chat_participant', 'left_chat_participant'
@ -685,6 +686,7 @@ class TelegramBot extends EventEmitter {
const chatMember = update.chat_member; const chatMember = update.chat_member;
const myChatMember = update.my_chat_member; const myChatMember = update.my_chat_member;
const chatJoinRequest = update.chat_join_request; const chatJoinRequest = update.chat_join_request;
const messageReaction = update.message_reaction;
if (message) { if (message) {
debug('Process Update message %j', message); debug('Process Update message %j', message);
@ -782,6 +784,9 @@ class TelegramBot extends EventEmitter {
} else if (chatJoinRequest) { } else if (chatJoinRequest) {
debug('Process Update my_chat_member %j', chatJoinRequest); debug('Process Update my_chat_member %j', chatJoinRequest);
this.emit('chat_join_request', chatJoinRequest); this.emit('chat_join_request', chatJoinRequest);
} else if (messageReaction) {
debug('Process Update message_reaction %j', messageReaction);
this.emit('message_reaction', messageReaction);
} }
} }