Add UpdateEvent abstract class

This commit is contained in:
netkas 2024-11-01 18:04:02 -04:00
parent b58aa3a5fc
commit 95346f78cd

View 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;
}