1
0
mirror of https://github.com/danog/MadelineProto.git synced 2025-01-22 12:51:21 +01:00

Add sendCustomEvent API method and onUpdateCustomEvent event handler method

This commit is contained in:
Daniil Gentili 2023-04-26 21:57:38 +02:00
parent 378a5c0eb0
commit 382cd3f0a7
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
2 changed files with 14 additions and 0 deletions

View File

@ -1350,6 +1350,13 @@ abstract class InternalDoc
{
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.
*/

View File

@ -630,4 +630,11 @@ trait UpdateHandler
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]);
}
}