diff --git a/src/TgBotLib/Classes/Utilities.php b/src/TgBotLib/Classes/Utilities.php index 64082af..73a74e5 100644 --- a/src/TgBotLib/Classes/Utilities.php +++ b/src/TgBotLib/Classes/Utilities.php @@ -76,6 +76,11 @@ return EventType::CHAT_JOIN_REQUEST_EVENT; } + if($update->getChatMember() !== null) + { + return EventType::CHAT_MEMBER_UPDATED; + } + return EventType::UPDATE_EVENT; } } \ No newline at end of file diff --git a/src/TgBotLib/Enums/EventType.php b/src/TgBotLib/Enums/EventType.php index 9f6ee87..1d56c62 100644 --- a/src/TgBotLib/Enums/EventType.php +++ b/src/TgBotLib/Enums/EventType.php @@ -5,6 +5,7 @@ use TgBotLib\Abstracts\UpdateEvent; use TgBotLib\Events\ChatBoostEvent; use TgBotLib\Events\ChatJoinRequestEvent; + use TgBotLib\Events\ChatMemberUpdatedEvent; use TgBotLib\Events\RemovedChatBoostEvent; enum EventType : string @@ -13,4 +14,5 @@ case REMOVED_CHAT_BOOST_EVENT = RemovedChatBoostEvent::class; case CHAT_BOOST_EVENT = ChatBoostEvent::class; case CHAT_JOIN_REQUEST_EVENT = ChatJoinRequestEvent::class; + case CHAT_MEMBER_UPDATED = ChatMemberUpdatedEvent::class; } diff --git a/src/TgBotLib/Events/ChatMemberUpdatedEvent.php b/src/TgBotLib/Events/ChatMemberUpdatedEvent.php new file mode 100644 index 0000000..6872bf5 --- /dev/null +++ b/src/TgBotLib/Events/ChatMemberUpdatedEvent.php @@ -0,0 +1,29 @@ +update->getChatMember(); + } + } \ No newline at end of file