diff --git a/src/TgBotLib/Enums/Methods.php b/src/TgBotLib/Enums/Methods.php index 933aad0..5cfea81 100644 --- a/src/TgBotLib/Enums/Methods.php +++ b/src/TgBotLib/Enums/Methods.php @@ -18,6 +18,7 @@ use TgBotLib\Methods\GetUserProfilePhotos; use TgBotLib\Methods\GetWebhookInfo; use TgBotLib\Methods\Logout; + use TgBotLib\Methods\PromoteChatMember; use TgBotLib\Methods\RestrictChatMember; use TgBotLib\Methods\SendAnimation; use TgBotLib\Methods\SendAudio; @@ -74,6 +75,7 @@ case BAN_CHAT_MEMBER = 'banChatMember'; case UNBAN_CHAT_MEMBER = 'unbanChatMember'; case RESTRICT_CHAT_MEMBER = 'restrictChatMember'; + case PROMOTE_CHAT_MEMBER = 'promoteChatMember'; /** * Executes a command on the provided bot with the given parameters. @@ -120,6 +122,7 @@ self::BAN_CHAT_MEMBER => BanChatMember::execute($bot, $parameters), self::UNBAN_CHAT_MEMBER => UnbanChatMember::execute($bot, $parameters), self::RESTRICT_CHAT_MEMBER => RestrictChatMember::execute($bot, $parameters), + self::PROMOTE_CHAT_MEMBER => PromoteChatMember::execute($bot, $parameters), }; } } diff --git a/src/TgBotLib/Methods/PromoteChatMember.php b/src/TgBotLib/Methods/PromoteChatMember.php new file mode 100644 index 0000000..76a973b --- /dev/null +++ b/src/TgBotLib/Methods/PromoteChatMember.php @@ -0,0 +1,54 @@ +sendRequest(Methods::PROMOTE_CHAT_MEMBER->value, $parameters); + } + + /** + * @inheritDoc + */ + public static function getRequiredParameters(): ?array + { + return [ + 'chat_id', + 'user_id' + ]; + } + + /** + * @inheritDoc + */ + public static function getOptionalParameters(): ?array + { + return [ + 'is_anonymous', + 'can_manage_chat', + 'can_delete_messages', + 'can_manage_video_chats', + 'can_restrict_members', + 'can_promote_members', + 'can_change_info', + 'can_invite_users', + 'can_post_stories', + 'can_edit_stories', + 'can_delete_stories', + 'can_post_messages', + 'can_edit_messages', + 'can_pin_messages', + 'can_manage_topics' + ]; + } + } \ No newline at end of file