mirror of
https://github.com/BushlanovDev/max-bot-api-client-php.git
synced 2026-10-10 13:58:58 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user