Add UpdateEvent abstract class
This commit is contained in:
parent
b58aa3a5fc
commit
95346f78cd
1 changed files with 34 additions and 0 deletions
34
src/TgBotLib/Abstracts/UpdateEvent.php
Normal file
34
src/TgBotLib/Abstracts/UpdateEvent.php
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace TgBotLib\Abstracts;
|
||||||
|
|
||||||
|
use TgBotLib\Bot;
|
||||||
|
use TgBotLib\Enums\EventType;
|
||||||
|
use TgBotLib\Objects\Update;
|
||||||
|
|
||||||
|
abstract class UpdateEvent
|
||||||
|
{
|
||||||
|
protected Update $update;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor for the class.
|
||||||
|
*
|
||||||
|
* @param Update $update The update instance to be used.
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function __construct(Update $update)
|
||||||
|
{
|
||||||
|
$this->update = $update;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the event type.
|
||||||
|
* @return EventType The event type of the current instance.
|
||||||
|
*/
|
||||||
|
public static function getEventType(): EventType
|
||||||
|
{
|
||||||
|
return EventType::UPDATE_EVENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract function handle(Bot $bot): void;
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue