Add support for business message events

This commit is contained in:
netkas 2024-11-03 17:11:16 -05:00
parent b40ee01d6e
commit 2f87996bd3
3 changed files with 36 additions and 0 deletions

View file

@ -0,0 +1,29 @@
<?php
namespace TgBotLib\Events;
use TgBotLib\Abstracts\UpdateEvent;
use TgBotLib\Bot;
use TgBotLib\Enums\UpdateEventType;
use TgBotLib\Objects\Message;
abstract class BusinessMessageEvent extends UpdateEvent
{
/**
* @inheritDoc
*/
public static function getEventType(): UpdateEventType
{
return UpdateEventType::BUSINESS_MESSAGE;
}
/**
* New incoming business message
*
* @return Message
*/
protected function getBusinessMessage(): Message
{
return $this->update->getBusinessMessage();
}
}