diff --git a/src/TgBotLib/Classes/Utilities.php b/src/TgBotLib/Classes/Utilities.php index 339764b..e4651f0 100644 --- a/src/TgBotLib/Classes/Utilities.php +++ b/src/TgBotLib/Classes/Utilities.php @@ -101,6 +101,11 @@ return UpdateEventType::PAID_MEDIA_PURCHASED; } + if($update->getPreCheckoutQuery() !== null) + { + return UpdateEventType::PRE_CHECKOUT_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 41a9c97..047f9b6 100644 --- a/src/TgBotLib/Enums/UpdateEventType.php +++ b/src/TgBotLib/Enums/UpdateEventType.php @@ -10,6 +10,7 @@ use TgBotLib\Events\PollAnswerEvent; use TgBotLib\Events\PollEvent; use TgBotLib\Events\PaidMediaPurchasedEvent; + use TgBotLib\Events\PreCheckoutQueryEvent; use TgBotLib\Events\RemovedChatBoostEvent; enum UpdateEventType : string @@ -23,4 +24,5 @@ case POLL_ANSWER = PollAnswerEvent::class; case POLL = PollEvent::class; case PAID_MEDIA_PURCHASED = PaidMediaPurchasedEvent::class; + case PRE_CHECKOUT_QUERY = PreCheckoutQueryEvent::class; } diff --git a/src/TgBotLib/Events/PreCheckoutQueryEvent.php b/src/TgBotLib/Events/PreCheckoutQueryEvent.php new file mode 100644 index 0000000..8ae749d --- /dev/null +++ b/src/TgBotLib/Events/PreCheckoutQueryEvent.php @@ -0,0 +1,29 @@ +update->getPreCheckoutQuery(); + } + } \ No newline at end of file