From d45bf4f2611cc304e5ffd7dcf6cddcb9bed1b563 Mon Sep 17 00:00:00 2001 From: netkas Date: Wed, 13 Nov 2024 15:29:53 -0500 Subject: [PATCH] Add GetMyDescription method to fetch bot description --- src/TgBotLib/Enums/Methods.php | 3 ++ src/TgBotLib/Methods/GetMyDescription.php | 38 +++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 src/TgBotLib/Methods/GetMyDescription.php diff --git a/src/TgBotLib/Enums/Methods.php b/src/TgBotLib/Enums/Methods.php index 3b416a0..3b179fc 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\GetMyDescription; use TgBotLib\Methods\GetMyName; use TgBotLib\Methods\GetUpdates; use TgBotLib\Methods\GetUserChatBoosts; @@ -172,6 +173,7 @@ case SET_MY_NAME = 'setMyName'; case GET_MY_NAME = 'getMyName'; case SET_MY_DESCRIPTION = 'setMyDescription'; + case GET_MY_DESCRIPTION = 'getMyDescription'; /** * Executes a command on the provided bot with the given parameters. @@ -267,6 +269,7 @@ self::SET_MY_NAME => SetMyName::execute($bot, $parameters), self::GET_MY_NAME => GetMyName::execute($bot, $parameters), self::SET_MY_DESCRIPTION => SetMyDescription::execute($bot, $parameters), + self::GET_MY_DESCRIPTION => GetMyDescription::execute($bot, $parameters), }; } } diff --git a/src/TgBotLib/Methods/GetMyDescription.php b/src/TgBotLib/Methods/GetMyDescription.php new file mode 100644 index 0000000..b29f9b2 --- /dev/null +++ b/src/TgBotLib/Methods/GetMyDescription.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