From ecac3c6ae5b1c1c5fc03fd858f6a73f458e60461 Mon Sep 17 00:00:00 2001 From: netkas Date: Thu, 28 Nov 2024 00:24:43 -0500 Subject: [PATCH] Add SetGameScore method --- src/TgBotLib/Enums/Methods.php | 3 ++ src/TgBotLib/Methods/SetGameScore.php | 44 +++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 src/TgBotLib/Methods/SetGameScore.php diff --git a/src/TgBotLib/Enums/Methods.php b/src/TgBotLib/Enums/Methods.php index 39baf1b..d9c54b3 100644 --- a/src/TgBotLib/Enums/Methods.php +++ b/src/TgBotLib/Enums/Methods.php @@ -105,6 +105,7 @@ use TgBotLib\Methods\SetChatStickerSet; use TgBotLib\Methods\SetChatTitle; use TgBotLib\Methods\SetCustomEmojiStickerSetThumbnail; + use TgBotLib\Methods\SetGameScore; use TgBotLib\Methods\SetMessageReaction; use TgBotLib\Methods\SetMyCommands; use TgBotLib\Methods\SetMyDefaultAdministratorRights; @@ -254,6 +255,7 @@ case GET_STAR_TRANSACTIONS = 'getStarTransactions'; case SET_PASSPORT_DATA_ERRORS = 'setPassportDataErrors'; case SEND_GAME = 'sendGame'; + case SET_GAME_SCORE = 'setGameScore'; /** * Executes a command on the provided bot with the given parameters. @@ -390,6 +392,7 @@ self::GET_STAR_TRANSACTIONS => GetStarTransactions::execute($bot, $parameters), self::SET_PASSPORT_DATA_ERRORS => SetPassportDataErrors::execute($bot, $parameters), self::SEND_GAME => SendGame::execute($bot, $parameters), + self::SET_GAME_SCORE => SetGameScore::execute($bot, $parameters), }; } } diff --git a/src/TgBotLib/Methods/SetGameScore.php b/src/TgBotLib/Methods/SetGameScore.php new file mode 100644 index 0000000..2af64b7 --- /dev/null +++ b/src/TgBotLib/Methods/SetGameScore.php @@ -0,0 +1,44 @@ +value, $parameters)); + } + + /** + * @inheritDoc + */ + public static function getRequiredParameters(): ?array + { + return [ + 'user_id', + 'score' + ]; + } + + /** + * @inheritDoc + */ + public static function getOptionalParameters(): ?array + { + return [ + 'force', + 'disable_edit_message', + 'chat_id', + 'message_id', + 'inline_message_id' + ]; + } + } \ No newline at end of file