diff --git a/src/TgBotLib/Classes/Utilities.php b/src/TgBotLib/Classes/Utilities.php index 96d926d..aaf9558 100644 --- a/src/TgBotLib/Classes/Utilities.php +++ b/src/TgBotLib/Classes/Utilities.php @@ -91,6 +91,11 @@ return UpdateEventType::POLL_ANSWER; } + if($update->getPoll() !== null) + { + return UpdateEventType::POLL; + } + 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 f0a9106..3dc8383 100644 --- a/src/TgBotLib/Enums/UpdateEventType.php +++ b/src/TgBotLib/Enums/UpdateEventType.php @@ -8,6 +8,7 @@ use TgBotLib\Events\ChatMemberUpdatedEvent; use TgBotLib\Events\MyChatMemberUpdatedEvent; use TgBotLib\Events\PollAnswerEvent; + use TgBotLib\Events\PollEvent; use TgBotLib\Events\RemovedChatBoostEvent; enum UpdateEventType : string @@ -19,4 +20,5 @@ case CHAT_MEMBER_UPDATED = ChatMemberUpdatedEvent::class; case MY_CHAT_MEMBER_UPDATED = MyChatMemberUpdatedEvent::class; case POLL_ANSWER = PollAnswerEvent::class; + case POLL = PollEvent::class; } diff --git a/src/TgBotLib/Events/PollEvent.php b/src/TgBotLib/Events/PollEvent.php new file mode 100644 index 0000000..372024b --- /dev/null +++ b/src/TgBotLib/Events/PollEvent.php @@ -0,0 +1,29 @@ +update->getPoll(); + } + } \ No newline at end of file