diff --git a/src/TgBotLib/Enums/Methods.php b/src/TgBotLib/Enums/Methods.php index b18d20d..502e2ff 100644 --- a/src/TgBotLib/Enums/Methods.php +++ b/src/TgBotLib/Enums/Methods.php @@ -31,6 +31,7 @@ use TgBotLib\Methods\SendVideo; use TgBotLib\Methods\SendVideoNote; use TgBotLib\Methods\SendVoice; + use TgBotLib\Methods\SetMessageReaction; use TgBotLib\Methods\SetWebhook; enum Methods : string @@ -62,6 +63,7 @@ case SEND_CHAT_ACTION = 'sendChatAction'; case DELETE_WEBHOOK = 'deleteWebhook'; case GET_WEBHOOK_INFO = 'getWebhookInfo'; + case SET_MESSAGE_REACTION = 'setMessageReaction'; /** * Executes a command on the provided bot with the given parameters. @@ -102,6 +104,7 @@ self::SEND_POLL => SendPoll::execute($bot, $parameters), self::SEND_DICE => SendDice::execute($bot, $parameters), self::SEND_CHAT_ACTION => SendChatAction::execute($bot, $parameters), + self::SET_MESSAGE_REACTION => SetMessageReaction::execute($bot, $parameters), }; } } diff --git a/src/TgBotLib/Methods/SetMessageReaction.php b/src/TgBotLib/Methods/SetMessageReaction.php new file mode 100644 index 0000000..a898053 --- /dev/null +++ b/src/TgBotLib/Methods/SetMessageReaction.php @@ -0,0 +1,46 @@ +value;}, $parameters['reaction'])); + } + + return self::executeCurl(self::buildPost($bot, Methods::SET_MESSAGE_REACTION->value, $parameters)); + } + + /** + * @inheritDoc + */ + public static function getRequiredParameters(): ?array + { + return [ + 'chat_id', + 'message_id' + ]; + } + + /** + * @inheritDoc + */ + public static function getOptionalParameters(): ?array + { + return [ + 'reaction', + 'is_big' + ]; + } + } \ No newline at end of file