diff --git a/CHANGELOG.md b/CHANGELOG.md index 65bd1ea9b..67d95ce3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,9 +7,12 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c ### Notes - [:ledger: View file changes][Unreleased] ### Added +- Code snippet in `GenericmessageCommand` to keep obsolete service message system commands working. +- Static boolean property `SystemCommand::$execute_deprecated` (must be assigned before handling the request) to try and execute any deprecated system command. ### Changed ### Deprecated ### Removed +- Service message system commands, which are now handled by `GenericmessageCommand`. ### Fixed - Boolean value for Polls gets saved correctly in MySQL DB. ### Security diff --git a/src/Commands/SystemCommand.php b/src/Commands/SystemCommand.php index 011774f21..56bd5e01f 100644 --- a/src/Commands/SystemCommand.php +++ b/src/Commands/SystemCommand.php @@ -10,11 +10,18 @@ namespace Longman\TelegramBot\Commands; +use Longman\TelegramBot\Conversation; use Longman\TelegramBot\Entities\ServerResponse; +use Longman\TelegramBot\Exception\TelegramException; use Longman\TelegramBot\Request; abstract class SystemCommand extends Command { + /** + * @var bool Try to execute any deprecated system command. + */ + public static $execute_deprecated = false; + /** * @{inheritdoc} * @@ -32,7 +39,85 @@ abstract class SystemCommand extends Command */ public function execute() { - //System command, return empty ServerResponse by default + // System command, return empty ServerResponse by default return Request::emptyResponse(); } + + /** + * Method to execute any active conversation. + * + * @return ServerResponse|null + * @throws TelegramException + * @internal + */ + protected function executeActiveConversation() + { + $message = $this->getMessage(); + if ($message === null) { + return null; + } + + $user = $message->getFrom(); + $chat = $message->getChat(); + if ($user === null || $chat === null) { + return null; + } + + // If a conversation is busy, execute the conversation command after handling the message. + $conversation = new Conversation($user->getId(), $chat->getId()); + + // Fetch conversation command if it exists and execute it. + if ($conversation->exists() && ($command = $conversation->getCommand())) { + return $this->getTelegram()->executeCommand($command); + } + + return null; + } + + /** + * BC helper method to execute deprecated system commands. + * + * @return ServerResponse|null + * @throws TelegramException + * @internal + */ + protected function executeDeprecatedSystemCommand() + { + $message = $this->getMessage(); + if ($message === null) { + return null; + } + + // List of service messages previously handled internally. + $service_message_getters = [ + 'newchatmembers' => 'getNewChatMembers', + 'leftchatmember' => 'getLeftChatMember', + 'newchattitle' => 'getNewChatTitle', + 'newchatphoto' => 'getNewChatPhoto', + 'deletechatphoto' => 'getDeleteChatPhoto', + 'groupchatcreated' => 'getGroupChatCreated', + 'supergroupchatcreated' => 'getSupergroupChatCreated', + 'channelchatcreated' => 'getChannelChatCreated', + 'migratefromchatid' => 'getMigrateFromChatId', + 'migratetochatid' => 'getMigrateToChatId', + 'pinnedmessage' => 'getPinnedMessage', + 'successfulpayment' => 'getSuccessfulPayment', + ]; + + foreach ($service_message_getters as $command => $service_message_getter) { + // Let's check if this message is a service message. + if ($message->$service_message_getter() === null) { + continue; + } + + // Make sure the command exists otherwise GenericCommand would be executed. + if ($this->getTelegram()->getCommandObject($command) === null) { + break; + } + + return $this->getTelegram()->executeCommand($command); + } + + return null; + } } diff --git a/src/Commands/SystemCommands/ChannelchatcreatedCommand.php b/src/Commands/SystemCommands/ChannelchatcreatedCommand.php deleted file mode 100644 index 170dca930..000000000 --- a/src/Commands/SystemCommands/ChannelchatcreatedCommand.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Longman\TelegramBot\Commands\SystemCommands; - -use Longman\TelegramBot\Commands\SystemCommand; - -/** - * Channel chat created command - * - * @todo Remove due to deprecation! - */ -class ChannelchatcreatedCommand extends SystemCommand -{ - /** - * @var string - */ - protected $name = 'channelchatcreated'; - - /** - * @var string - */ - protected $description = 'Channel chat created'; - - /** - * @var string - */ - protected $version = '1.0.0'; - - /** - * Command execute method - * - * @return mixed - */ - public function execute() - { - //$message = $this->getMessage(); - //$channel_chat_created = $message->getChannelChatCreated(); - - trigger_error(__CLASS__ . ' is deprecated and will be removed and handled by ' . GenericmessageCommand::class . ' by default in a future release.', E_USER_DEPRECATED); - - return parent::execute(); - } -} diff --git a/src/Commands/SystemCommands/ChannelpostCommand.php b/src/Commands/SystemCommands/ChannelpostCommand.php deleted file mode 100644 index 57ff83d05..000000000 --- a/src/Commands/SystemCommands/ChannelpostCommand.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Longman\TelegramBot\Commands\SystemCommands; - -use Longman\TelegramBot\Commands\SystemCommand; - -/** - * Channel post command - * - * @todo Remove due to deprecation! - */ -class ChannelpostCommand extends SystemCommand -{ - /** - * @var string - */ - protected $name = 'channelpost'; - - /** - * @var string - */ - protected $description = 'Handle channel post'; - - /** - * @var string - */ - protected $version = '1.0.0'; - - /** - * Execute command - * - * @return mixed - */ - public function execute() - { - //$channel_post = $this->getUpdate()->getChannelPost(); - - trigger_error(__CLASS__ . ' is deprecated and will be removed and handled by ' . GenericmessageCommand::class . ' by default in a future release.', E_USER_DEPRECATED); - - return parent::execute(); - } -} diff --git a/src/Commands/SystemCommands/ChoseninlineresultCommand.php b/src/Commands/SystemCommands/ChoseninlineresultCommand.php deleted file mode 100644 index b4400cf9e..000000000 --- a/src/Commands/SystemCommands/ChoseninlineresultCommand.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Longman\TelegramBot\Commands\SystemCommands; - -use Longman\TelegramBot\Commands\SystemCommand; - -/** - * Chosen inline result command - * - * @todo Remove due to deprecation! - */ -class ChoseninlineresultCommand extends SystemCommand -{ - /** - * @var string - */ - protected $name = 'choseninlineresult'; - - /** - * @var string - */ - protected $description = 'Chosen result query'; - - /** - * @var string - */ - protected $version = '1.0.0'; - - /** - * Command execute method - * - * @return mixed - */ - public function execute() - { - //Information about chosen result is returned - //$update = $this->getUpdate(); - //$inline_query = $update->getChosenInlineResult(); - //$query = $inline_query->getQuery(); - - trigger_error(__CLASS__ . ' is deprecated and will be removed and handled by ' . GenericmessageCommand::class . ' by default in a future release.', E_USER_DEPRECATED); - - return parent::execute(); - } -} diff --git a/src/Commands/SystemCommands/DeletechatphotoCommand.php b/src/Commands/SystemCommands/DeletechatphotoCommand.php deleted file mode 100644 index 3c2bd1f9d..000000000 --- a/src/Commands/SystemCommands/DeletechatphotoCommand.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Longman\TelegramBot\Commands\SystemCommands; - -use Longman\TelegramBot\Commands\SystemCommand; - -/** - * Delete chat photo command - * - * @todo Remove due to deprecation! - */ -class DeletechatphotoCommand extends SystemCommand -{ - /** - * @var string - */ - protected $name = 'deletechatphoto'; - - /** - * @var string - */ - protected $description = 'Delete chat photo'; - - /** - * @var string - */ - protected $version = '1.0.0'; - - /** - * Command execute method - * - * @return mixed - */ - public function execute() - { - //$message = $this->getMessage(); - //$delete_chat_photo = $message->getDeleteChatPhoto(); - - trigger_error(__CLASS__ . ' is deprecated and will be removed and handled by ' . GenericmessageCommand::class . ' by default in a future release.', E_USER_DEPRECATED); - - return parent::execute(); - } -} diff --git a/src/Commands/SystemCommands/EditedchannelpostCommand.php b/src/Commands/SystemCommands/EditedchannelpostCommand.php deleted file mode 100644 index 85d018279..000000000 --- a/src/Commands/SystemCommands/EditedchannelpostCommand.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Longman\TelegramBot\Commands\SystemCommands; - -use Longman\TelegramBot\Commands\SystemCommand; - -/** - * Edited channel post command - * - * @todo Remove due to deprecation! - */ -class EditedchannelpostCommand extends SystemCommand -{ - /** - * @var string - */ - protected $name = 'editedchannelpost'; - - /** - * @var string - */ - protected $description = 'Handle edited channel post'; - - /** - * @var string - */ - protected $version = '1.0.0'; - - /** - * Execute command - * - * @return mixed - */ - public function execute() - { - //$edited_channel_post = $this->getUpdate()->getEditedChannelPost(); - - trigger_error(__CLASS__ . ' is deprecated and will be removed and handled by ' . GenericmessageCommand::class . ' by default in a future release.', E_USER_DEPRECATED); - - return parent::execute(); - } -} diff --git a/src/Commands/SystemCommands/EditedmessageCommand.php b/src/Commands/SystemCommands/EditedmessageCommand.php deleted file mode 100644 index b92f3c006..000000000 --- a/src/Commands/SystemCommands/EditedmessageCommand.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Longman\TelegramBot\Commands\SystemCommands; - -use Longman\TelegramBot\Commands\SystemCommand; - -/** - * Edited message command - * - * @todo Remove due to deprecation! - */ -class EditedmessageCommand extends SystemCommand -{ - /** - * @var string - */ - protected $name = 'editedmessage'; - - /** - * @var string - */ - protected $description = 'User edited message'; - - /** - * @var string - */ - protected $version = '1.0.0'; - - /** - * Command execute method - * - * @return mixed - */ - public function execute() - { - //$update = $this->getUpdate(); - //$edited_message = $update->getEditedMessage(); - - trigger_error(__CLASS__ . ' is deprecated and will be removed and handled by ' . GenericmessageCommand::class . ' by default in a future release.', E_USER_DEPRECATED); - - return parent::execute(); - } -} diff --git a/src/Commands/SystemCommands/GenericCommand.php b/src/Commands/SystemCommands/GenericCommand.php index 4cda448d8..a42c8c65c 100644 --- a/src/Commands/SystemCommands/GenericCommand.php +++ b/src/Commands/SystemCommands/GenericCommand.php @@ -11,7 +11,6 @@ namespace Longman\TelegramBot\Commands\SystemCommands; use Longman\TelegramBot\Commands\SystemCommand; -use Longman\TelegramBot\Entities\ServerResponse; /** * Generic command @@ -31,21 +30,5 @@ class GenericCommand extends SystemCommand /** * @var string */ - protected $version = '1.0.0'; - - /** - * Command execute method - * - * @return ServerResponse - */ - public function execute() - { - //$message = $this->getMessage(); - //$chat_id = $message->getChat()->getId(); - //$user_id = $message->getFrom()->getId(); - //$command = $message->getCommand(); - //$text = trim($message->getText(true)); - - return parent::execute(); - } + protected $version = '1.1.0'; } diff --git a/src/Commands/SystemCommands/GenericmessageCommand.php b/src/Commands/SystemCommands/GenericmessageCommand.php index e69a48305..89ae2c884 100644 --- a/src/Commands/SystemCommands/GenericmessageCommand.php +++ b/src/Commands/SystemCommands/GenericmessageCommand.php @@ -11,7 +11,6 @@ namespace Longman\TelegramBot\Commands\SystemCommands; use Longman\TelegramBot\Commands\SystemCommand; -use Longman\TelegramBot\Conversation; use Longman\TelegramBot\Entities\ServerResponse; use Longman\TelegramBot\Exception\TelegramException; use Longman\TelegramBot\Request; @@ -34,7 +33,7 @@ class GenericmessageCommand extends SystemCommand /** * @var string */ - protected $version = '1.1.0'; + protected $version = '1.2.0'; /** * @var bool @@ -45,10 +44,15 @@ class GenericmessageCommand extends SystemCommand * Execution if MySQL is required but not available * * @return ServerResponse + * @throws TelegramException */ public function executeNoDb() { - //Do nothing + // Try to execute any deprecated system commands. + if (self::$execute_deprecated && $deprecated_system_command_response = $this->executeDeprecatedSystemCommand()) { + return $deprecated_system_command_response; + } + return Request::emptyResponse(); } @@ -60,15 +64,14 @@ public function executeNoDb() */ public function execute() { - //If a conversation is busy, execute the conversation command after handling the message - $conversation = new Conversation( - $this->getMessage()->getFrom()->getId(), - $this->getMessage()->getChat()->getId() - ); + // Try to continue any active conversation. + if ($active_conversation_response = $this->executeActiveConversation()) { + return $active_conversation_response; + } - //Fetch conversation command if it exists and execute it - if ($conversation->exists() && ($command = $conversation->getCommand())) { - return $this->telegram->executeCommand($command); + // Try to execute any deprecated system commands. + if (self::$execute_deprecated && $deprecated_system_command_response = $this->executeDeprecatedSystemCommand()) { + return $deprecated_system_command_response; } return Request::emptyResponse(); diff --git a/src/Commands/SystemCommands/GroupchatcreatedCommand.php b/src/Commands/SystemCommands/GroupchatcreatedCommand.php deleted file mode 100644 index 10013dccf..000000000 --- a/src/Commands/SystemCommands/GroupchatcreatedCommand.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Longman\TelegramBot\Commands\SystemCommands; - -use Longman\TelegramBot\Commands\SystemCommand; - -/** - * Group chat created command - * - * @todo Remove due to deprecation! - */ -class GroupchatcreatedCommand extends SystemCommand -{ - /** - * @var string - */ - protected $name = 'groupchatcreated'; - - /** - * @var string - */ - protected $description = 'Group chat created'; - - /** - * @var string - */ - protected $version = '1.0.0'; - - /** - * Command execute method - * - * @return mixed - */ - public function execute() - { - //$message = $this->getMessage(); - //$group_chat_created = $message->getGroupChatCreated(); - - trigger_error(__CLASS__ . ' is deprecated and will be removed and handled by ' . GenericmessageCommand::class . ' by default in a future release.', E_USER_DEPRECATED); - - return parent::execute(); - } -} diff --git a/src/Commands/SystemCommands/LeftchatmemberCommand.php b/src/Commands/SystemCommands/LeftchatmemberCommand.php deleted file mode 100644 index dc81f17f9..000000000 --- a/src/Commands/SystemCommands/LeftchatmemberCommand.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Longman\TelegramBot\Commands\SystemCommands; - -use Longman\TelegramBot\Commands\SystemCommand; - -/** - * Left chat member command - * - * @todo Remove due to deprecation! - */ -class LeftchatmemberCommand extends SystemCommand -{ - /** - * @var string - */ - protected $name = 'leftchatmember'; - - /** - * @var string - */ - protected $description = 'Left Chat Member'; - - /** - * @var string - */ - protected $version = '1.0.0'; - - /** - * Command execute method - * - * @return mixed - */ - public function execute() - { - //$message = $this->getMessage(); - //$member = $message->getLeftChatMember(); - - trigger_error(__CLASS__ . ' is deprecated and will be removed and handled by ' . GenericmessageCommand::class . ' by default in a future release.', E_USER_DEPRECATED); - - return parent::execute(); - } -} diff --git a/src/Commands/SystemCommands/MigratefromchatidCommand.php b/src/Commands/SystemCommands/MigratefromchatidCommand.php deleted file mode 100644 index 0d26f70d1..000000000 --- a/src/Commands/SystemCommands/MigratefromchatidCommand.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Longman\TelegramBot\Commands\SystemCommands; - -use Longman\TelegramBot\Commands\SystemCommand; - -/** - * Migrate from chat id command - * - * @todo Remove due to deprecation! - */ -class MigratefromchatidCommand extends SystemCommand -{ - /** - * @var string - */ - protected $name = 'migratefromchatid'; - - /** - * @var string - */ - protected $description = 'Migrate from chat id'; - - /** - * @var string - */ - protected $version = '1.0.0'; - - /** - * Command execute method - * - * @return mixed - */ - public function execute() - { - //$message = $this->getMessage(); - //$migrate_from_chat_id = $message->getMigrateFromChatId(); - - trigger_error(__CLASS__ . ' is deprecated and will be removed and handled by ' . GenericmessageCommand::class . ' by default in a future release.', E_USER_DEPRECATED); - - return parent::execute(); - } -} diff --git a/src/Commands/SystemCommands/MigratetochatidCommand.php b/src/Commands/SystemCommands/MigratetochatidCommand.php deleted file mode 100644 index 324a52ef8..000000000 --- a/src/Commands/SystemCommands/MigratetochatidCommand.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Longman\TelegramBot\Commands\SystemCommands; - -use Longman\TelegramBot\Commands\SystemCommand; - -/** - * Migrate to chat id command - * - * @todo Remove due to deprecation! - */ -class MigratetochatidCommand extends SystemCommand -{ - /** - * @var string - */ - protected $name = 'migratetochatid'; - - /** - * @var string - */ - protected $description = 'Migrate to chat id'; - - /** - * @var string - */ - protected $version = '1.0.0'; - - /** - * Command execute method - * - * @return mixed - */ - public function execute() - { - //$message = $this->getMessage(); - //$migrate_to_chat_id = $message->getMigrateToChatId(); - - trigger_error(__CLASS__ . ' is deprecated and will be removed and handled by ' . GenericmessageCommand::class . ' by default in a future release.', E_USER_DEPRECATED); - - return parent::execute(); - } -} diff --git a/src/Commands/SystemCommands/NewchatmembersCommand.php b/src/Commands/SystemCommands/NewchatmembersCommand.php deleted file mode 100644 index 658dbb909..000000000 --- a/src/Commands/SystemCommands/NewchatmembersCommand.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Longman\TelegramBot\Commands\SystemCommands; - -use Longman\TelegramBot\Commands\SystemCommand; - -/** - * New chat members command - * - * @todo Remove due to deprecation! - */ -class NewchatmembersCommand extends SystemCommand -{ - /** - * @var string - */ - protected $name = 'newchatmembers'; - - /** - * @var string - */ - protected $description = 'New Chat Member(s)'; - - /** - * @var string - */ - protected $version = '1.0.0'; - - /** - * Command execute method - * - * @return mixed - */ - public function execute() - { - //$message = $this->getMessage(); - //$members = $message->getNewChatMembers(); - - trigger_error(__CLASS__ . ' is deprecated and will be removed and handled by ' . GenericmessageCommand::class . ' by default in a future release.', E_USER_DEPRECATED); - - return parent::execute(); - } -} diff --git a/src/Commands/SystemCommands/NewchatphotoCommand.php b/src/Commands/SystemCommands/NewchatphotoCommand.php deleted file mode 100644 index 98f08d376..000000000 --- a/src/Commands/SystemCommands/NewchatphotoCommand.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Longman\TelegramBot\Commands\SystemCommands; - -use Longman\TelegramBot\Commands\SystemCommand; - -/** - * New chat photo command - * - * @todo Remove due to deprecation! - */ -class NewchatphotoCommand extends SystemCommand -{ - /** - * @var string - */ - protected $name = 'newchatphoto'; - - /** - * @var string - */ - protected $description = 'New chat Photo'; - - /** - * @var string - */ - protected $version = '1.0.0'; - - /** - * Command execute method - * - * @return mixed - */ - public function execute() - { - //$message = $this->getMessage(); - //$new_chat_photo = $message->getNewChatPhoto(); - - trigger_error(__CLASS__ . ' is deprecated and will be removed and handled by ' . GenericmessageCommand::class . ' by default in a future release.', E_USER_DEPRECATED); - - return parent::execute(); - } -} diff --git a/src/Commands/SystemCommands/NewchattitleCommand.php b/src/Commands/SystemCommands/NewchattitleCommand.php deleted file mode 100644 index 518fe76e5..000000000 --- a/src/Commands/SystemCommands/NewchattitleCommand.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Longman\TelegramBot\Commands\SystemCommands; - -use Longman\TelegramBot\Commands\SystemCommand; - -/** - * New chat title command - * - * @todo Remove due to deprecation! - */ -class NewchattitleCommand extends SystemCommand -{ - /** - * @var string - */ - protected $name = 'newchattitle'; - - /** - * @var string - */ - protected $description = 'New chat Title'; - - /** - * @var string - */ - protected $version = '1.0.0'; - - /** - * Command execute method - * - * @return mixed - */ - public function execute() - { - //$message = $this->getMessage(); - //$new_chat_title = $message->getNewChatTitle(); - - trigger_error(__CLASS__ . ' is deprecated and will be removed and handled by ' . GenericmessageCommand::class . ' by default in a future release.', E_USER_DEPRECATED); - - return parent::execute(); - } -} diff --git a/src/Commands/SystemCommands/PinnedmessageCommand.php b/src/Commands/SystemCommands/PinnedmessageCommand.php deleted file mode 100644 index 5a751f306..000000000 --- a/src/Commands/SystemCommands/PinnedmessageCommand.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Longman\TelegramBot\Commands\SystemCommands; - -use Longman\TelegramBot\Commands\SystemCommand; - -/** - * Pinned message command - * - * @todo Remove due to deprecation! - */ -class PinnedmessageCommand extends SystemCommand -{ - /** - * @var string - */ - protected $name = 'pinnedmessage'; - - /** - * @var string - */ - protected $description = 'Message was pinned'; - - /** - * @var string - */ - protected $version = '1.0.0'; - - /** - * Execute command - * - * @return mixed - */ - public function execute() - { - //$message = $this->getMessage(); - //$pinned_message = $message->getPinnedMessage(); - - trigger_error(__CLASS__ . ' is deprecated and will be removed and handled by ' . GenericmessageCommand::class . ' by default in a future release.', E_USER_DEPRECATED); - - return parent::execute(); - } -} diff --git a/src/Commands/SystemCommands/SupergroupchatcreatedCommand.php b/src/Commands/SystemCommands/SupergroupchatcreatedCommand.php deleted file mode 100644 index 9c2508b2a..000000000 --- a/src/Commands/SystemCommands/SupergroupchatcreatedCommand.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Longman\TelegramBot\Commands\SystemCommands; - -use Longman\TelegramBot\Commands\SystemCommand; - -/** - * Super group chat created command - * - * @todo Remove due to deprecation! - */ -class SupergroupchatcreatedCommand extends SystemCommand -{ - /** - * @var string - */ - protected $name = 'supergroupchatcreated'; - - /** - * @var string - */ - protected $description = 'Super group chat created'; - - /** - * @var string - */ - protected $version = '1.0.0'; - - /** - * Command execute method - * - * @return mixed - */ - public function execute() - { - //$message = $this->getMessage(); - //$supergroup_chat_created = $message->getSuperGroupChatCreated(); - - trigger_error(__CLASS__ . ' is deprecated and will be removed and handled by ' . GenericmessageCommand::class . ' by default in a future release.', E_USER_DEPRECATED); - - return parent::execute(); - } -}