Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BugFix in chat.promote #1082

Merged
merged 1 commit into from Dec 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 12 additions & 2 deletions aiogram/types/chat.py
Expand Up @@ -312,14 +312,18 @@ async def restrict(self, user_id: base.Integer,
async def promote(self,
user_id: base.Integer,
is_anonymous: typing.Optional[base.Boolean] = None,
can_manage_chat: 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,
can_delete_messages: typing.Optional[base.Boolean] = None,
can_manage_voice_chats: typing.Optional[base.Boolean] = None,
can_invite_users: typing.Optional[base.Boolean] = None,
can_restrict_members: typing.Optional[base.Boolean] = None,
can_pin_messages: typing.Optional[base.Boolean] = None,
can_promote_members: typing.Optional[base.Boolean] = None) -> base.Boolean:
can_promote_members: typing.Optional[base.Boolean] = None,
can_manage_video_chats: typing.Optional[base.Boolean] = None,
can_manage_topics: typing.Optional[base.Boolean] = None,) -> base.Boolean:
"""
Use this method to promote or demote a user in a supergroup or a channel.
The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
Expand Down Expand Up @@ -362,6 +366,7 @@ async def promote(self,
: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,
Expand All @@ -372,7 +377,12 @@ async def promote(self,
can_invite_users=can_invite_users,
can_restrict_members=can_restrict_members,
can_pin_messages=can_pin_messages,
can_promote_members=can_promote_members)
can_promote_members=can_promote_members,
can_manage_chat=can_manage_chat,
can_manage_voice_chats=can_manage_voice_chats,
can_manage_video_chats=can_manage_video_chats,
can_manage_topics=can_manage_topics
)

async def set_permissions(self, permissions: ChatPermissions) -> base.Boolean:
"""
Expand Down