From 775a5ab71f4c1ea2c72e165ed4d9f8c5d228023a Mon Sep 17 00:00:00 2001 From: netkas Date: Sat, 2 Nov 2024 00:24:18 -0400 Subject: [PATCH] Add support for deleted business messages event --- src/TgBotLib/Classes/Utilities.php | 5 ++++ src/TgBotLib/Enums/UpdateEventType.php | 2 ++ .../Events/DeletedBusinessMessagesEvent.php | 29 +++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 src/TgBotLib/Events/DeletedBusinessMessagesEvent.php diff --git a/src/TgBotLib/Classes/Utilities.php b/src/TgBotLib/Classes/Utilities.php index 952a4bc..6d84823 100644 --- a/src/TgBotLib/Classes/Utilities.php +++ b/src/TgBotLib/Classes/Utilities.php @@ -136,6 +136,11 @@ return UpdateEventType::MESSAGE_REACTION; } + if($update->getDeletedBusinessMessages() !== null) + { + return UpdateEventType::DELETED_BUSINESS_MESSAGES; + } + 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 e8983ac..29b4d4d 100644 --- a/src/TgBotLib/Enums/UpdateEventType.php +++ b/src/TgBotLib/Enums/UpdateEventType.php @@ -8,6 +8,7 @@ use TgBotLib\Events\ChatJoinRequestEvent; use TgBotLib\Events\ChatMemberUpdatedEvent; use TgBotLib\Events\ChosenInlineResultEvent; + use TgBotLib\Events\DeletedBusinessMessagesEvent; use TgBotLib\Events\InlineQueryEvent; use TgBotLib\Events\MessageReactionCountEvent; use TgBotLib\Events\MessageReactionEvent; @@ -38,4 +39,5 @@ case INLINE_QUERY = InlineQueryEvent::class; case MESSAGE_REACTION_COUNT = MessageReactionCountEvent::class; case MESSAGE_REACTION = MessageReactionEvent::class; + case DELETED_BUSINESS_MESSAGES = DeletedBusinessMessagesEvent::class; } diff --git a/src/TgBotLib/Events/DeletedBusinessMessagesEvent.php b/src/TgBotLib/Events/DeletedBusinessMessagesEvent.php new file mode 100644 index 0000000..e20d324 --- /dev/null +++ b/src/TgBotLib/Events/DeletedBusinessMessagesEvent.php @@ -0,0 +1,29 @@ +update->getDeletedBusinessMessages(); + } + } \ No newline at end of file