Move UpdateEvent to Events and remove unused import

This commit is contained in:
netkas 2024-11-06 15:02:43 -05:00
parent 24fe2f2b91
commit 646c77c4ba
27 changed files with 4 additions and 28 deletions

View file

@ -2,7 +2,6 @@
namespace TgBotLib\Events;
use TgBotLib\Abstracts\UpdateEvent;
use TgBotLib\Enums\EventType;
use TgBotLib\Objects\BusinessConnection;

View file

@ -2,7 +2,6 @@
namespace TgBotLib\Events;
use TgBotLib\Abstracts\UpdateEvent;
use TgBotLib\Enums\EventType;
use TgBotLib\Objects\Message;

View file

@ -2,7 +2,6 @@
namespace TgBotLib\Events;
use TgBotLib\Abstracts\UpdateEvent;
use TgBotLib\Enums\EventType;
use TgBotLib\Objects\CallbackQuery;

View file

@ -2,7 +2,6 @@
namespace TgBotLib\Events;
use TgBotLib\Abstracts\UpdateEvent;
use TgBotLib\Enums\EventType;
use TgBotLib\Objects\Message;

View file

@ -2,7 +2,6 @@
namespace TgBotLib\Events;
use TgBotLib\Abstracts\UpdateEvent;
use TgBotLib\Enums\EventType;
use TgBotLib\Objects\ChatBoostUpdated;

View file

@ -2,7 +2,6 @@
namespace TgBotLib\Events;
use TgBotLib\Abstracts\UpdateEvent;
use TgBotLib\Enums\EventType;
use TgBotLib\Objects\ChatJoinRequest;

View file

@ -2,7 +2,6 @@
namespace TgBotLib\Events;
use TgBotLib\Abstracts\UpdateEvent;
use TgBotLib\Enums\EventType;
use TgBotLib\Objects\ChatMemberUpdated;

View file

@ -2,7 +2,6 @@
namespace TgBotLib\Events;
use TgBotLib\Abstracts\UpdateEvent;
use TgBotLib\Enums\EventType;
use TgBotLib\Objects\Inline\ChosenInlineResult;

View file

@ -3,7 +3,6 @@
namespace TgBotLib\Events;
use OptsLib\Parse;
use TgBotLib\Abstracts\UpdateEvent;
use TgBotLib\Enums\EventType;
use TgBotLib\Objects\Message;

View file

@ -2,7 +2,6 @@
namespace TgBotLib\Events;
use TgBotLib\Abstracts\UpdateEvent;
use TgBotLib\Enums\EventType;
use TgBotLib\Objects\BusinessMessagesDeleted;

View file

@ -2,7 +2,6 @@
namespace TgBotLib\Events;
use TgBotLib\Abstracts\UpdateEvent;
use TgBotLib\Enums\EventType;
use TgBotLib\Objects\Message;

View file

@ -2,7 +2,6 @@
namespace TgBotLib\Events;
use TgBotLib\Abstracts\UpdateEvent;
use TgBotLib\Enums\EventType;
use TgBotLib\Objects\Message;

View file

@ -2,7 +2,6 @@
namespace TgBotLib\Events;
use TgBotLib\Abstracts\UpdateEvent;
use TgBotLib\Enums\EventType;
use TgBotLib\Objects\Message;

View file

@ -2,7 +2,6 @@
namespace TgBotLib\Events;
use TgBotLib\Abstracts\UpdateEvent;
use TgBotLib\Enums\EventType;
use TgBotLib\Objects\Inline\InlineQuery;

View file

@ -2,7 +2,6 @@
namespace TgBotLib\Events;
use TgBotLib\Abstracts\UpdateEvent;
use TgBotLib\Enums\EventType;
use TgBotLib\Objects\Message;

View file

@ -2,7 +2,6 @@
namespace TgBotLib\Events;
use TgBotLib\Abstracts\UpdateEvent;
use TgBotLib\Enums\EventType;
use TgBotLib\Objects\MessageReactionCountUpdated;

View file

@ -2,7 +2,6 @@
namespace TgBotLib\Events;
use TgBotLib\Abstracts\UpdateEvent;
use TgBotLib\Enums\EventType;
use TgBotLib\Objects\MessageReactionUpdated;

View file

@ -3,7 +3,6 @@
namespace TgBotLib\Events;
use TgBotLib\Abstracts\UpdateEvent;
use TgBotLib\Enums\EventType;
use TgBotLib\Objects\ChatMemberUpdated;

View file

@ -2,7 +2,6 @@
namespace TgBotLib\Events;
use TgBotLib\Abstracts\UpdateEvent;
use TgBotLib\Enums\EventType;
use TgBotLib\Objects\Payments\PaidMediaPurchased;

View file

@ -2,7 +2,6 @@
namespace TgBotLib\Events;
use TgBotLib\Abstracts\UpdateEvent;
use TgBotLib\Enums\EventType;
use TgBotLib\Objects\PollAnswer;

View file

@ -2,7 +2,6 @@
namespace TgBotLib\Events;
use TgBotLib\Abstracts\UpdateEvent;
use TgBotLib\Enums\EventType;
use TgBotLib\Objects\Poll;

View file

@ -2,7 +2,6 @@
namespace TgBotLib\Events;
use TgBotLib\Abstracts\UpdateEvent;
use TgBotLib\Enums\EventType;
use TgBotLib\Objects\Payments\PreCheckoutQuery;

View file

@ -2,7 +2,6 @@
namespace TgBotLib\Events;
use TgBotLib\Abstracts\UpdateEvent;
use TgBotLib\Enums\EventType;
use TgBotLib\Objects\ChatBoostRemoved;

View file

@ -2,7 +2,6 @@
namespace TgBotLib\Events;
use TgBotLib\Abstracts\UpdateEvent;
use TgBotLib\Enums\EventType;
use TgBotLib\Objects\Payments\ShippingQuery;

View file

@ -0,0 +1,42 @@
<?php
namespace TgBotLib\Events;
use TgBotLib\Bot;
use TgBotLib\Enums\EventType;
use TgBotLib\Exceptions\TelegramException;
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;
}
/**
* Abstract method to handle the bot instance.
*
* @param Bot $bot The bot instance to be handled.
* @return void
* @throws TelegramException
*/
public abstract function handle(Bot $bot): void;
}