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

feat: Add support for new event "chat_join_request"

This commit is contained in:
Daniel Pérez Fernández 2021-11-07 16:07:50 +01:00
parent 15c878ea89
commit 6c0f2e73c0

View File

@ -624,6 +624,7 @@ class TelegramBot extends EventEmitter {
const pollAnswer = update.poll_answer;
const chatMember = update.chat_member;
const myChatMember = update.my_chat_member;
const chatJoinRequest = update.chat_join_request;
if (message) {
debug('Process Update message %j', message);
@ -713,6 +714,9 @@ class TelegramBot extends EventEmitter {
} else if (myChatMember) {
debug('Process Update my_chat_member %j', myChatMember);
this.emit('my_chat_member', myChatMember);
} else if (chatJoinRequest) {
debug('Process Update my_chat_member %j', chatJoinRequest);
this.emit('chat_join_request', chatJoinRequest);
}
}