diff --git a/src/InternalDoc.php b/src/InternalDoc.php index 16ded383b7..c71777d44b 100644 --- a/src/InternalDoc.php +++ b/src/InternalDoc.php @@ -1350,6 +1350,13 @@ public function secretChatStatus(int $chat): int { return $this->wrapper->getAPI()->secretChatStatus($chat); } + /** + * Sends an updateCustomEvent update to the event handler. + */ + public function sendCustomEvent(mixed $payload): void + { + $this->wrapper->getAPI()->sendCustomEvent($payload); + } /** * Set NOOP update handler, ignoring all updates. */ diff --git a/src/MTProtoTools/UpdateHandler.php b/src/MTProtoTools/UpdateHandler.php index 99aab6f50d..63a282651b 100644 --- a/src/MTProtoTools/UpdateHandler.php +++ b/src/MTProtoTools/UpdateHandler.php @@ -630,4 +630,11 @@ private function handleUpdate(array $update): void UpdateHandlerType::GET_UPDATES => $this->signalUpdate(...), }, $update); } + /** + * Sends an updateCustomEvent update to the event handler. + */ + public function sendCustomEvent(mixed $payload): void + { + $this->handleUpdate(['_' => 'updateCustomEvent', 'payload' => $payload]); + } }