diff --git a/src/TgBotLib/Classes/Utilities.php b/src/TgBotLib/Classes/Utilities.php index bd69677..1ccb981 100644 --- a/src/TgBotLib/Classes/Utilities.php +++ b/src/TgBotLib/Classes/Utilities.php @@ -146,6 +146,11 @@ return UpdateEventType::EDITED_BUSINESS_MESSAGE; } + if($update->getBusinessMessage() !== null) + { + return UpdateEventType::BUSINESS_MESSAGE; + } + 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 2a2afb3..f66fe35 100644 --- a/src/TgBotLib/Enums/UpdateEventType.php +++ b/src/TgBotLib/Enums/UpdateEventType.php @@ -3,6 +3,7 @@ namespace TgBotLib\Enums; use TgBotLib\Abstracts\UpdateEvent; + use TgBotLib\Events\BusinessMessageEvent; use TgBotLib\Events\CallbackQueryEvent; use TgBotLib\Events\ChatBoostEvent; use TgBotLib\Events\ChatJoinRequestEvent; @@ -42,4 +43,5 @@ case MESSAGE_REACTION = MessageReactionEvent::class; case DELETED_BUSINESS_MESSAGES = DeletedBusinessMessagesEvent::class; case EDITED_BUSINESS_MESSAGE = EditedBusinessMessageEvent::class; + case BUSINESS_MESSAGE = BusinessMessageEvent::class; } diff --git a/src/TgBotLib/Events/BusinessMessageEvent.php b/src/TgBotLib/Events/BusinessMessageEvent.php new file mode 100644 index 0000000..5e8b6a1 --- /dev/null +++ b/src/TgBotLib/Events/BusinessMessageEvent.php @@ -0,0 +1,29 @@ +update->getBusinessMessage(); + } + } \ No newline at end of file