diff --git a/src/TgBotLib/Classes/Utilities.php b/src/TgBotLib/Classes/Utilities.php index ab06a82..6a6d5e8 100644 --- a/src/TgBotLib/Classes/Utilities.php +++ b/src/TgBotLib/Classes/Utilities.php @@ -81,6 +81,11 @@ return UpdateEventType::CHAT_MEMBER_UPDATED; } + if($update->getMyChatMember() !== null) + { + return UpdateEventType::MY_CHAT_MEMBER_UPDATED; + } + return UpdateEventType::UPDATE_EVENT; } } \ No newline at end of file diff --git a/src/TgBotLib/Enums/UpdateEventType.php b/src/TgBotLib/Enums/UpdateEventType.php index 6e5532c..428d1ec 100644 --- a/src/TgBotLib/Enums/UpdateEventType.php +++ b/src/TgBotLib/Enums/UpdateEventType.php @@ -6,6 +6,7 @@ use TgBotLib\Events\ChatBoostEvent; use TgBotLib\Events\ChatJoinRequestEvent; use TgBotLib\Events\ChatMemberUpdatedEvent; + use TgBotLib\Events\MyChatMemberUpdatedEvent; use TgBotLib\Events\RemovedChatBoostEvent; enum UpdateEventType : string @@ -15,4 +16,5 @@ case CHAT_BOOST_EVENT = ChatBoostEvent::class; case CHAT_JOIN_REQUEST_EVENT = ChatJoinRequestEvent::class; case CHAT_MEMBER_UPDATED = ChatMemberUpdatedEvent::class; + case MY_CHAT_MEMBER_UPDATED = MyChatMemberUpdatedEvent::class; } diff --git a/src/TgBotLib/Events/MyChatMemberUpdatedEvent.php b/src/TgBotLib/Events/MyChatMemberUpdatedEvent.php new file mode 100644 index 0000000..d60127f --- /dev/null +++ b/src/TgBotLib/Events/MyChatMemberUpdatedEvent.php @@ -0,0 +1,30 @@ +update->getMyChatMember(); + } + } \ No newline at end of file