Add support for handling channel post events
This commit is contained in:
parent
041c2dc84c
commit
2a08cc51de
3 changed files with 36 additions and 0 deletions
29
src/TgBotLib/Events/ChannelPostEvent.php
Normal file
29
src/TgBotLib/Events/ChannelPostEvent.php
Normal 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 ChannelPostEvent extends UpdateEvent
|
||||
{
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function getEventType(): UpdateEventType
|
||||
{
|
||||
return UpdateEventType::CHANNEL_POST;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the current channel post.
|
||||
*
|
||||
* @return Message The channel post message.
|
||||
*/
|
||||
protected function getChannelPost(): Message
|
||||
{
|
||||
return $this->update->getChannelPost();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue