Skip to content

Commit

Permalink
Add support for voice kicking.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rapptz committed Apr 30, 2019
1 parent 40cac30 commit 4dee175
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions discord/member.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,18 +469,22 @@ async def edit(self, *, reason=None, **fields):
All parameters are optional.
.. versionchanged:: 1.1.0
Can now pass ``None`` to ``voice_channel`` to kick a member from voice.
Parameters
-----------
nick: Optional[:class:`str`]
The member's new nickname. Use ``None`` to remove the nickname.
mute: Optional[:class:`bool`]
mute: :class:`bool`
Indicates if the member should be guild muted or un-muted.
deafen: Optional[:class:`bool`]
deafen: :class:`bool`
Indicates if the member should be guild deafened or un-deafened.
roles: Optional[List[:class:`Roles`]]
roles: List[:class:`Roles`]
The member's new list of roles. This *replaces* the roles.
voice_channel: Optional[:class:`VoiceChannel`]
The voice channel to move the member to.
Pass ``None`` to kick them from voice.
reason: Optional[:class:`str`]
The reason for editing this member. Shows up on the audit log.
Expand Down Expand Up @@ -520,7 +524,7 @@ async def edit(self, *, reason=None, **fields):
except KeyError:
pass
else:
payload['channel_id'] = vc.id
payload['channel_id'] = vc and vc.id

try:
roles = fields['roles']
Expand All @@ -543,10 +547,14 @@ async def move_to(self, channel, *, reason=None):
This raises the same exceptions as :meth:`edit`.
.. versionchanged:: 1.1.0
Can now pass ``None`` to kick a member from voice.
Parameters
-----------
channel: :class:`VoiceChannel`
channel: Optional[:class:`VoiceChannel`]
The new voice channel to move the member to.
Pass ``None`` to kick them from voice.
reason: Optional[:class:`str`]
The reason for doing this action. Shows up on the audit log.
"""
Expand Down

0 comments on commit 4dee175

Please sign in to comment.