Serialize after changing eventHandlers

This commit is contained in:
Alexander Pankratov 2023-12-23 14:35:10 +01:00
parent 354421d7b0
commit 4c942312af

View File

@ -517,9 +517,11 @@ class ApiExtensions
public function setEventHandler(): void
{
Client::getWrapper($this->madelineProto)->getAPI()->setEventHandler(EventHandler::class);
Client::getWrapper($this->madelineProto)->serialize();
}
public function getUpdates(array $params): array {
public function getUpdates(array $params): array
{
foreach ($params as $key => $value) {
$params[$key] = match($key) {
'offset', 'limit' => (int) $value,
@ -531,6 +533,18 @@ class ApiExtensions
return $this->madelineProto->getUpdates($params);
}
public function setNoop(): void
{
$this->madelineProto->setNoop();
Client::getWrapper($this->madelineProto)->serialize();
}
public function setWebhook(string $url): void
{
$this->madelineProto->setWebhook($url);
Client::getWrapper($this->madelineProto)->serialize();
}
public function unsubscribeFromUpdates(?string $channel = null): array {
$inputChannelId = null;
if ($channel) {