From c6a43c89c48dd6f2cc1860f926cb02eb8086f94a Mon Sep 17 00:00:00 2001 From: Daniil Kovalenko <40635760+WhiteMemory99@users.noreply.github.com> Date: Mon, 9 Nov 2020 01:35:09 +0700 Subject: [PATCH 1/2] Add missing parameter to promoteChatMember alias (#458) is_anonymous exists in the full method but is missing in its shortcut. --- aiogram/types/chat.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/aiogram/types/chat.py b/aiogram/types/chat.py index 0021eb23..1ff5dc75 100644 --- a/aiogram/types/chat.py +++ b/aiogram/types/chat.py @@ -282,7 +282,9 @@ class Chat(base.TelegramObject): can_send_other_messages=can_send_other_messages, can_add_web_page_previews=can_add_web_page_previews) - async def promote(self, user_id: base.Integer, + async def promote(self, + user_id: base.Integer, + is_anonymous: typing.Optional[base.Boolean] = None, can_change_info: typing.Optional[base.Boolean] = None, can_post_messages: typing.Optional[base.Boolean] = None, can_edit_messages: typing.Optional[base.Boolean] = None, @@ -300,29 +302,42 @@ class Chat(base.TelegramObject): :param user_id: Unique identifier of the target user :type user_id: :obj:`base.Integer` + + :param is_anonymous: Pass True, if the administrator's presence in the chat is hidden + :type is_anonymous: :obj:`typing.Optional[base.Boolean]` + :param can_change_info: Pass True, if the administrator can change chat title, photo and other settings :type can_change_info: :obj:`typing.Optional[base.Boolean]` + :param can_post_messages: Pass True, if the administrator can create channel posts, channels only :type can_post_messages: :obj:`typing.Optional[base.Boolean]` + :param can_edit_messages: Pass True, if the administrator can edit messages of other users, channels only :type can_edit_messages: :obj:`typing.Optional[base.Boolean]` + :param can_delete_messages: Pass True, if the administrator can delete messages of other users :type can_delete_messages: :obj:`typing.Optional[base.Boolean]` + :param can_invite_users: Pass True, if the administrator can invite new users to the chat :type can_invite_users: :obj:`typing.Optional[base.Boolean]` + :param can_restrict_members: Pass True, if the administrator can restrict, ban or unban chat members :type can_restrict_members: :obj:`typing.Optional[base.Boolean]` + :param can_pin_messages: Pass True, if the administrator can pin messages, supergroups only :type can_pin_messages: :obj:`typing.Optional[base.Boolean]` + :param can_promote_members: Pass True, if the administrator can add new administrators with a subset of his own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him) :type can_promote_members: :obj:`typing.Optional[base.Boolean]` + :return: Returns True on success. :rtype: :obj:`base.Boolean` """ return await self.bot.promote_chat_member(self.id, user_id=user_id, + is_anonymous=is_anonymous, can_change_info=can_change_info, can_post_messages=can_post_messages, can_edit_messages=can_edit_messages, From 44c1cc1f61d1badaf5d589788ef995457095652f Mon Sep 17 00:00:00 2001 From: Igor Date: Mon, 9 Nov 2020 00:59:16 +0300 Subject: [PATCH 2/2] Add parameter supports_streaming to reply_video, remove redundant docstrings (#459) --- aiogram/types/message.py | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/aiogram/types/message.py b/aiogram/types/message.py index 900b731c..ab56f363 100644 --- a/aiogram/types/message.py +++ b/aiogram/types/message.py @@ -1033,10 +1033,6 @@ class Message(base.TelegramObject): Source: https://core.telegram.org/bots/api#sendvenue - :param chat_id: Unique identifier for the target chat or username of the - target channel (in the format @channelusername) - :type chat_id: :obj:`typing.Union[base.Integer, base.String]` - :param latitude: Latitude of the venue :type latitude: :obj:`base.Float` @@ -1345,10 +1341,6 @@ class Message(base.TelegramObject): Source: https://core.telegram.org/bots/api#senddice - :param chat_id: Unique identifier for the target chat or username of the - target channel (in the format @channelusername) - :type chat_id: :obj:`typing.Union[base.Integer, base.String]` - :param emoji: Emoji on which the dice throw animation is based. Currently, must be one of “🎲”, “🎯”, “🏀”, “⚽”, or “🎰”. Dice can have values 1-6 for “🎲” and “🎯”, values 1-5 for “🏀” and “⚽”, and values 1-64 for “🎰”. @@ -1790,6 +1782,7 @@ class Message(base.TelegramObject): caption: typing.Optional[base.String] = None, parse_mode: typing.Optional[base.String] = None, caption_entities: typing.Optional[typing.List[MessageEntity]] = None, + supports_streaming: typing.Optional[base.Boolean] = None, disable_notification: typing.Optional[base.Boolean] = None, allow_sending_without_reply: typing.Optional[base.Boolean] = None, reply_markup: typing.Union[ @@ -1834,6 +1827,9 @@ class Message(base.TelegramObject): which can be specified instead of parse_mode :type caption_entities: :obj:`typing.Optional[typing.List[MessageEntity]]` + :param supports_streaming: Pass True, if the uploaded video is suitable for streaming + :type supports_streaming: :obj:`typing.Optional[base.Boolean]` + :param disable_notification: Sends the message silently. Users will receive a notification with no sound. :type disable_notification: :obj:`typing.Optional[base.Boolean]` @@ -1862,6 +1858,7 @@ class Message(base.TelegramObject): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + supports_streaming=supports_streaming, disable_notification=disable_notification, reply_to_message_id=self.message_id if reply else None, allow_sending_without_reply=allow_sending_without_reply, @@ -2122,10 +2119,6 @@ class Message(base.TelegramObject): Source: https://core.telegram.org/bots/api#sendvenue - :param chat_id: Unique identifier for the target chat or username of the - target channel (in the format @channelusername) - :type chat_id: :obj:`typing.Union[base.Integer, base.String]` - :param latitude: Latitude of the venue :type latitude: :obj:`base.Float` @@ -2434,10 +2427,6 @@ class Message(base.TelegramObject): Source: https://core.telegram.org/bots/api#senddice - :param chat_id: Unique identifier for the target chat or username of the - target channel (in the format @channelusername) - :type chat_id: :obj:`typing.Union[base.Integer, base.String]` - :param emoji: Emoji on which the dice throw animation is based. Currently, must be one of “🎲”, “🎯”, “🏀”, “⚽”, or “🎰”. Dice can have values 1-6 for “🎲” and “🎯”, values 1-5 for “🏀” and “⚽”, and values 1-64 for “🎰”.