Add support for message reaction count events

This commit is contained in:
netkas 2024-11-02 00:20:28 -04:00
parent ac431136de
commit ada256566e
3 changed files with 38 additions and 0 deletions

View file

@ -0,0 +1,31 @@
<?php
namespace TgBotLib\Events;
use TgBotLib\Abstracts\UpdateEvent;
use TgBotLib\Bot;
use TgBotLib\Enums\UpdateEventType;
use TgBotLib\Objects\MessageReactionCountUpdated;
abstract class MessageReactionCountEvent extends UpdateEvent
{
/**
* @inheritDoc
*/
public static function getEventType(): UpdateEventType
{
return UpdateEventType::MESSAGE_REACTION_COUNT;
}
/**
* Reactions to a message with anonymous reactions were changed. The bot must be an administrator in the chat
* and must explicitly specify "message_reaction_count" in the list of allowed_updates to receive these updates.
* The updates are grouped and can be sent with delay up to a few minutes.
*
* @return MessageReactionCountUpdated
*/
protected function getMessageReactionCount(): MessageReactionCountUpdated
{
return $this->update->getMessageReactionCount();
}
}