Parse comment and bot admin permission updates

UpdateType already had comment_created, comment_edited,
comment_removed and bot_admin_permissions_changed, but ModelFactory
had no models for them and threw "Unknown or unsupported update type".
Adds the models from schema 0.0.33, maps them in createUpdate() and
adds on*() shortcuts to UpdateDispatcher and MaxBotManager.
This commit is contained in:
Timofey
2026-09-28 00:13:13 +05:00
parent 749c0aab5b
commit d1637add72
12 changed files with 454 additions and 0 deletions
+52
View File
@@ -359,6 +359,58 @@ readonly class MaxBotManager
$this->dispatcher->onMessageChatCreated($this->resolveHandler($handler));
}
/**
* Register a comment created handler.
*
* @param callable|string $handler Can be a closure, callable, or Laravel container binding.
*
* @throws BindingResolutionException
* @codeCoverageIgnore
*/
public function onCommentCreated(callable|string $handler): void
{
$this->dispatcher->onCommentCreated($this->resolveHandler($handler));
}
/**
* Register a comment edited handler.
*
* @param callable|string $handler Can be a closure, callable, or Laravel container binding.
*
* @throws BindingResolutionException
* @codeCoverageIgnore
*/
public function onCommentEdited(callable|string $handler): void
{
$this->dispatcher->onCommentEdited($this->resolveHandler($handler));
}
/**
* Register a comment removed handler.
*
* @param callable|string $handler Can be a closure, callable, or Laravel container binding.
*
* @throws BindingResolutionException
* @codeCoverageIgnore
*/
public function onCommentRemoved(callable|string $handler): void
{
$this->dispatcher->onCommentRemoved($this->resolveHandler($handler));
}
/**
* Register a bot admin permissions changed handler.
*
* @param callable|string $handler Can be a closure, callable, or Laravel container binding.
*
* @throws BindingResolutionException
* @codeCoverageIgnore
*/
public function onBotAdminPermissionsChanged(callable|string $handler): void
{
$this->dispatcher->onBotAdminPermissionsChanged($this->resolveHandler($handler));
}
/**
* Get the API instance.
* @codeCoverageIgnore