Add support for deleted business messages event
This commit is contained in:
parent
b4a7d69c3c
commit
775a5ab71f
3 changed files with 36 additions and 0 deletions
|
@ -136,6 +136,11 @@
|
|||
return UpdateEventType::MESSAGE_REACTION;
|
||||
}
|
||||
|
||||
if($update->getDeletedBusinessMessages() !== null)
|
||||
{
|
||||
return UpdateEventType::DELETED_BUSINESS_MESSAGES;
|
||||
}
|
||||
|
||||
return UpdateEventType::UPDATE_EVENT;
|
||||
}
|
||||
}
|
|
@ -8,6 +8,7 @@
|
|||
use TgBotLib\Events\ChatJoinRequestEvent;
|
||||
use TgBotLib\Events\ChatMemberUpdatedEvent;
|
||||
use TgBotLib\Events\ChosenInlineResultEvent;
|
||||
use TgBotLib\Events\DeletedBusinessMessagesEvent;
|
||||
use TgBotLib\Events\InlineQueryEvent;
|
||||
use TgBotLib\Events\MessageReactionCountEvent;
|
||||
use TgBotLib\Events\MessageReactionEvent;
|
||||
|
@ -38,4 +39,5 @@
|
|||
case INLINE_QUERY = InlineQueryEvent::class;
|
||||
case MESSAGE_REACTION_COUNT = MessageReactionCountEvent::class;
|
||||
case MESSAGE_REACTION = MessageReactionEvent::class;
|
||||
case DELETED_BUSINESS_MESSAGES = DeletedBusinessMessagesEvent::class;
|
||||
}
|
||||
|
|
29
src/TgBotLib/Events/DeletedBusinessMessagesEvent.php
Normal file
29
src/TgBotLib/Events/DeletedBusinessMessagesEvent.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\BusinessMessagesDeleted;
|
||||
|
||||
abstract class DeletedBusinessMessagesEvent extends UpdateEvent
|
||||
{
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function getEventType(): UpdateEventType
|
||||
{
|
||||
return UpdateEventType::DELETED_BUSINESS_MESSAGES;
|
||||
}
|
||||
|
||||
/**
|
||||
* Messages were deleted from a connected business account
|
||||
*
|
||||
* @return BusinessMessagesDeleted
|
||||
*/
|
||||
protected function getBusinessMessagesDeleted(): BusinessMessagesDeleted
|
||||
{
|
||||
return $this->update->getDeletedBusinessMessages();
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue