From bf648ec2afea7a90f2c7c95cd927a61e9693e0f2 Mon Sep 17 00:00:00 2001 From: netkas Date: Wed, 13 Nov 2024 15:25:17 -0500 Subject: [PATCH] Add GetMyName method to TgBotLib --- src/TgBotLib/Enums/Methods.php | 3 +++ src/TgBotLib/Methods/GetMyName.php | 38 ++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 src/TgBotLib/Methods/GetMyName.php diff --git a/src/TgBotLib/Enums/Methods.php b/src/TgBotLib/Enums/Methods.php index 71658cd..afda35d 100644 --- a/src/TgBotLib/Enums/Methods.php +++ b/src/TgBotLib/Enums/Methods.php @@ -39,6 +39,7 @@ use TgBotLib\Methods\GetForumTopicIconStickers; use TgBotLib\Methods\GetMe; use TgBotLib\Methods\GetMyCommands; + use TgBotLib\Methods\GetMyName; use TgBotLib\Methods\GetUpdates; use TgBotLib\Methods\GetUserChatBoosts; use TgBotLib\Methods\GetUserProfilePhotos; @@ -168,6 +169,7 @@ case DELETE_MY_COMMANDS = 'deleteMyCommands'; case GET_MY_COMMANDS = 'getMyCommands'; case SET_MY_NAME = 'setMyName'; + case GET_MY_NAME = 'getMyName'; /** * Executes a command on the provided bot with the given parameters. @@ -261,6 +263,7 @@ self::DELETE_MY_COMMANDS => DeleteMyCommands::execute($bot, $parameters), self::GET_MY_COMMANDS => GetMyCommands::execute($bot, $parameters), self::SET_MY_NAME => SetMyName::execute($bot, $parameters), + self::GET_MY_NAME => GetMyName::execute($bot, $parameters), }; } } diff --git a/src/TgBotLib/Methods/GetMyName.php b/src/TgBotLib/Methods/GetMyName.php new file mode 100644 index 0000000..1b99688 --- /dev/null +++ b/src/TgBotLib/Methods/GetMyName.php @@ -0,0 +1,38 @@ +value, $parameters))); + } + + /** + * @inheritDoc + */ + public static function getRequiredParameters(): ?array + { + return null; + } + + /** + * @inheritDoc + */ + public static function getOptionalParameters(): ?array + { + return [ + 'language_code' + ]; + } + } \ No newline at end of file