diff --git a/src/TgBotLib/Classes/Utilities.php b/src/TgBotLib/Classes/Utilities.php index 9c97e15..06a6daa 100644 --- a/src/TgBotLib/Classes/Utilities.php +++ b/src/TgBotLib/Classes/Utilities.php @@ -161,6 +161,11 @@ return UpdateEventType::EDITED_CHANNEL_POST; } + if($update->getChannelPost() !== null) + { + return UpdateEventType::CHANNEL_POST; + } + 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 71c6170..a51240d 100644 --- a/src/TgBotLib/Enums/UpdateEventType.php +++ b/src/TgBotLib/Enums/UpdateEventType.php @@ -6,6 +6,7 @@ use TgBotLib\Events\BusinessConnectionEvent; use TgBotLib\Events\BusinessMessageEvent; use TgBotLib\Events\CallbackQueryEvent; + use TgBotLib\Events\ChannelPostEvent; use TgBotLib\Events\ChatBoostEvent; use TgBotLib\Events\ChatJoinRequestEvent; use TgBotLib\Events\ChatMemberUpdatedEvent; @@ -47,4 +48,5 @@ case BUSINESS_MESSAGE = BusinessMessageEvent::class; case BUSINESS_CONNECTION = BusinessConnectionEvent::class; case EDITED_CHANNEL_POST = EditedChannelPostEvent::class; + case CHANNEL_POST = ChannelPostEvent::class; } diff --git a/src/TgBotLib/Events/ChannelPostEvent.php b/src/TgBotLib/Events/ChannelPostEvent.php new file mode 100644 index 0000000..dd257c3 --- /dev/null +++ b/src/TgBotLib/Events/ChannelPostEvent.php @@ -0,0 +1,29 @@ +update->getChannelPost(); + } + } \ No newline at end of file