Add support for message reaction event handling
This commit is contained in:
parent
ada256566e
commit
bcf23f3834
3 changed files with 38 additions and 0 deletions
31
src/TgBotLib/Events/MessageReactionEvent.php
Normal file
31
src/TgBotLib/Events/MessageReactionEvent.php
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
namespace TgBotLib\Events;
|
||||
|
||||
use TgBotLib\Abstracts\UpdateEvent;
|
||||
use TgBotLib\Bot;
|
||||
use TgBotLib\Enums\UpdateEventType;
|
||||
use TgBotLib\Objects\MessageReactionUpdated;
|
||||
|
||||
abstract class MessageReactionEvent extends UpdateEvent
|
||||
{
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function getEventType(): UpdateEventType
|
||||
{
|
||||
return UpdateEventType::MESSAGE_REACTION;
|
||||
}
|
||||
|
||||
/**
|
||||
* A reaction to a message was changed by a user. The bot must be an administrator in the chat and must
|
||||
* explicitly specify "message_reaction" in the list of allowed_updates to receive these updates.
|
||||
* The update isn't received for reactions set by bots.
|
||||
*
|
||||
* @return MessageReactionUpdated
|
||||
*/
|
||||
protected function getMessageReactionUpdated(): MessageReactionUpdated
|
||||
{
|
||||
return $this->update->getMessageReaction();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue