Move UpdateEvent to Events and remove unused import
This commit is contained in:
parent
24fe2f2b91
commit
646c77c4ba
27 changed files with 4 additions and 28 deletions
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace TgBotLib\Events;
|
||||
|
||||
use TgBotLib\Abstracts\UpdateEvent;
|
||||
use TgBotLib\Enums\EventType;
|
||||
use TgBotLib\Objects\BusinessConnection;
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace TgBotLib\Events;
|
||||
|
||||
use TgBotLib\Abstracts\UpdateEvent;
|
||||
use TgBotLib\Enums\EventType;
|
||||
use TgBotLib\Objects\Message;
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace TgBotLib\Events;
|
||||
|
||||
use TgBotLib\Abstracts\UpdateEvent;
|
||||
use TgBotLib\Enums\EventType;
|
||||
use TgBotLib\Objects\CallbackQuery;
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace TgBotLib\Events;
|
||||
|
||||
use TgBotLib\Abstracts\UpdateEvent;
|
||||
use TgBotLib\Enums\EventType;
|
||||
use TgBotLib\Objects\Message;
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace TgBotLib\Events;
|
||||
|
||||
use TgBotLib\Abstracts\UpdateEvent;
|
||||
use TgBotLib\Enums\EventType;
|
||||
use TgBotLib\Objects\ChatBoostUpdated;
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace TgBotLib\Events;
|
||||
|
||||
use TgBotLib\Abstracts\UpdateEvent;
|
||||
use TgBotLib\Enums\EventType;
|
||||
use TgBotLib\Objects\ChatJoinRequest;
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace TgBotLib\Events;
|
||||
|
||||
use TgBotLib\Abstracts\UpdateEvent;
|
||||
use TgBotLib\Enums\EventType;
|
||||
use TgBotLib\Objects\ChatMemberUpdated;
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace TgBotLib\Events;
|
||||
|
||||
use TgBotLib\Abstracts\UpdateEvent;
|
||||
use TgBotLib\Enums\EventType;
|
||||
use TgBotLib\Objects\Inline\ChosenInlineResult;
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
namespace TgBotLib\Events;
|
||||
|
||||
use OptsLib\Parse;
|
||||
use TgBotLib\Abstracts\UpdateEvent;
|
||||
use TgBotLib\Enums\EventType;
|
||||
use TgBotLib\Objects\Message;
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace TgBotLib\Events;
|
||||
|
||||
use TgBotLib\Abstracts\UpdateEvent;
|
||||
use TgBotLib\Enums\EventType;
|
||||
use TgBotLib\Objects\BusinessMessagesDeleted;
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace TgBotLib\Events;
|
||||
|
||||
use TgBotLib\Abstracts\UpdateEvent;
|
||||
use TgBotLib\Enums\EventType;
|
||||
use TgBotLib\Objects\Message;
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace TgBotLib\Events;
|
||||
|
||||
use TgBotLib\Abstracts\UpdateEvent;
|
||||
use TgBotLib\Enums\EventType;
|
||||
use TgBotLib\Objects\Message;
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace TgBotLib\Events;
|
||||
|
||||
use TgBotLib\Abstracts\UpdateEvent;
|
||||
use TgBotLib\Enums\EventType;
|
||||
use TgBotLib\Objects\Message;
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace TgBotLib\Events;
|
||||
|
||||
use TgBotLib\Abstracts\UpdateEvent;
|
||||
use TgBotLib\Enums\EventType;
|
||||
use TgBotLib\Objects\Inline\InlineQuery;
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace TgBotLib\Events;
|
||||
|
||||
use TgBotLib\Abstracts\UpdateEvent;
|
||||
use TgBotLib\Enums\EventType;
|
||||
use TgBotLib\Objects\Message;
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace TgBotLib\Events;
|
||||
|
||||
use TgBotLib\Abstracts\UpdateEvent;
|
||||
use TgBotLib\Enums\EventType;
|
||||
use TgBotLib\Objects\MessageReactionCountUpdated;
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace TgBotLib\Events;
|
||||
|
||||
use TgBotLib\Abstracts\UpdateEvent;
|
||||
use TgBotLib\Enums\EventType;
|
||||
use TgBotLib\Objects\MessageReactionUpdated;
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
namespace TgBotLib\Events;
|
||||
|
||||
|
||||
use TgBotLib\Abstracts\UpdateEvent;
|
||||
use TgBotLib\Enums\EventType;
|
||||
use TgBotLib\Objects\ChatMemberUpdated;
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace TgBotLib\Events;
|
||||
|
||||
use TgBotLib\Abstracts\UpdateEvent;
|
||||
use TgBotLib\Enums\EventType;
|
||||
use TgBotLib\Objects\Payments\PaidMediaPurchased;
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace TgBotLib\Events;
|
||||
|
||||
use TgBotLib\Abstracts\UpdateEvent;
|
||||
use TgBotLib\Enums\EventType;
|
||||
use TgBotLib\Objects\PollAnswer;
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace TgBotLib\Events;
|
||||
|
||||
use TgBotLib\Abstracts\UpdateEvent;
|
||||
use TgBotLib\Enums\EventType;
|
||||
use TgBotLib\Objects\Poll;
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace TgBotLib\Events;
|
||||
|
||||
use TgBotLib\Abstracts\UpdateEvent;
|
||||
use TgBotLib\Enums\EventType;
|
||||
use TgBotLib\Objects\Payments\PreCheckoutQuery;
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace TgBotLib\Events;
|
||||
|
||||
use TgBotLib\Abstracts\UpdateEvent;
|
||||
use TgBotLib\Enums\EventType;
|
||||
use TgBotLib\Objects\ChatBoostRemoved;
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace TgBotLib\Events;
|
||||
|
||||
use TgBotLib\Abstracts\UpdateEvent;
|
||||
use TgBotLib\Enums\EventType;
|
||||
use TgBotLib\Objects\Payments\ShippingQuery;
|
||||
|
||||
|
|
42
src/TgBotLib/Events/UpdateEvent.php
Normal file
42
src/TgBotLib/Events/UpdateEvent.php
Normal 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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue