From 4a3295e63d72a177f425517ec65a06198daa092a Mon Sep 17 00:00:00 2001 From: Andrei Date: Wed, 1 May 2019 13:17:43 -0700 Subject: [PATCH] Add GuildMember.disconnect to disconnect a member from voice --- disco/types/guild.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/disco/types/guild.py b/disco/types/guild.py index a4cc0b4..30a3369 100644 --- a/disco/types/guild.py +++ b/disco/types/guild.py @@ -219,6 +219,12 @@ class GuildMember(SlottedModel): else: self.client.api.guilds_members_modify(self.guild.id, self.user.id, nick=nickname or '', **kwargs) + def disconnect(self): + """ + Disconnects the member from voice (if they are connected). + """ + self.modify(channel_id=None) + def modify(self, **kwargs): self.client.api.guilds_members_modify(self.guild.id, self.user.id, **kwargs)