diff --git a/src/TgBotLib/Classes/Utilities.php b/src/TgBotLib/Classes/Utilities.php index 6a6d5e8..96d926d 100644 --- a/src/TgBotLib/Classes/Utilities.php +++ b/src/TgBotLib/Classes/Utilities.php @@ -86,6 +86,11 @@ return UpdateEventType::MY_CHAT_MEMBER_UPDATED; } + if($update->getPollAnswer() !== null) + { + return UpdateEventType::POLL_ANSWER; + } + 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 428d1ec..f0a9106 100644 --- a/src/TgBotLib/Enums/UpdateEventType.php +++ b/src/TgBotLib/Enums/UpdateEventType.php @@ -7,6 +7,7 @@ use TgBotLib\Events\ChatJoinRequestEvent; use TgBotLib\Events\ChatMemberUpdatedEvent; use TgBotLib\Events\MyChatMemberUpdatedEvent; + use TgBotLib\Events\PollAnswerEvent; use TgBotLib\Events\RemovedChatBoostEvent; enum UpdateEventType : string @@ -17,4 +18,5 @@ case CHAT_JOIN_REQUEST_EVENT = ChatJoinRequestEvent::class; case CHAT_MEMBER_UPDATED = ChatMemberUpdatedEvent::class; case MY_CHAT_MEMBER_UPDATED = MyChatMemberUpdatedEvent::class; + case POLL_ANSWER = PollAnswerEvent::class; } diff --git a/src/TgBotLib/Events/PollAnswerEvent.php b/src/TgBotLib/Events/PollAnswerEvent.php new file mode 100644 index 0000000..4c91fdc --- /dev/null +++ b/src/TgBotLib/Events/PollAnswerEvent.php @@ -0,0 +1,30 @@ +update->getPollAnswer(); + } + } \ No newline at end of file