diff --git a/src/TgBotLib/Classes/Utilities.php b/src/TgBotLib/Classes/Utilities.php index 98edc3b..790d40f 100644 --- a/src/TgBotLib/Classes/Utilities.php +++ b/src/TgBotLib/Classes/Utilities.php @@ -111,6 +111,11 @@ return UpdateEventType::PRE_CHECKOUT_QUERY; } + if($update->getCallbackQuery() !== null) + { + return UpdateEventType::CALLBACK_QUERY; + } + 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 bd3b279..d960ca5 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\CallbackQueryEvent; use TgBotLib\Events\ChatBoostEvent; use TgBotLib\Events\ChatJoinRequestEvent; use TgBotLib\Events\ChatMemberUpdatedEvent; @@ -27,4 +28,5 @@ case PAID_MEDIA_PURCHASED = PaidMediaPurchasedEvent::class; case PRE_CHECKOUT_QUERY = PreCheckoutQueryEvent::class; case SHIPPING_QUERY = ShippingQueryEvent::class; + case CALLBACK_QUERY = CallbackQueryEvent::class; } diff --git a/src/TgBotLib/Events/CallbackQueryEvent.php b/src/TgBotLib/Events/CallbackQueryEvent.php new file mode 100644 index 0000000..f01d21c --- /dev/null +++ b/src/TgBotLib/Events/CallbackQueryEvent.php @@ -0,0 +1,28 @@ +update->getCallbackQuery(); + } + } \ No newline at end of file