Add support for edited business messages
This commit is contained in:
parent
775a5ab71f
commit
b40ee01d6e
3 changed files with 35 additions and 0 deletions
|
@ -141,6 +141,11 @@
|
|||
return UpdateEventType::DELETED_BUSINESS_MESSAGES;
|
||||
}
|
||||
|
||||
if($update->getEditedBusinessMessage() !== null)
|
||||
{
|
||||
return UpdateEventType::EDITED_BUSINESS_MESSAGE;
|
||||
}
|
||||
|
||||
return UpdateEventType::UPDATE_EVENT;
|
||||
}
|
||||
}
|
|
@ -9,6 +9,7 @@
|
|||
use TgBotLib\Events\ChatMemberUpdatedEvent;
|
||||
use TgBotLib\Events\ChosenInlineResultEvent;
|
||||
use TgBotLib\Events\DeletedBusinessMessagesEvent;
|
||||
use TgBotLib\Events\EditedBusinessMessageEvent;
|
||||
use TgBotLib\Events\InlineQueryEvent;
|
||||
use TgBotLib\Events\MessageReactionCountEvent;
|
||||
use TgBotLib\Events\MessageReactionEvent;
|
||||
|
@ -40,4 +41,5 @@
|
|||
case MESSAGE_REACTION_COUNT = MessageReactionCountEvent::class;
|
||||
case MESSAGE_REACTION = MessageReactionEvent::class;
|
||||
case DELETED_BUSINESS_MESSAGES = DeletedBusinessMessagesEvent::class;
|
||||
case EDITED_BUSINESS_MESSAGE = EditedBusinessMessageEvent::class;
|
||||
}
|
||||
|
|
28
src/TgBotLib/Events/EditedBusinessMessageEvent.php
Normal file
28
src/TgBotLib/Events/EditedBusinessMessageEvent.php
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
namespace TgBotLib\Events;
|
||||
|
||||
use TgBotLib\Abstracts\UpdateEvent;
|
||||
use TgBotLib\Enums\UpdateEventType;
|
||||
use TgBotLib\Objects\Message;
|
||||
|
||||
abstract class EditedBusinessMessageEvent extends UpdateEvent
|
||||
{
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function getEventType(): UpdateEventType
|
||||
{
|
||||
return UpdateEventType::EDITED_BUSINESS_MESSAGE;
|
||||
}
|
||||
|
||||
/**
|
||||
* New incoming edited business message
|
||||
*
|
||||
* @return Message
|
||||
*/
|
||||
protected function getEditedBusinessMessage(): Message
|
||||
{
|
||||
return $this->update->getEditedBusinessMessage();
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue