From 12031c3d7315bae62c24fa41a7fa61d88f3b0c46 Mon Sep 17 00:00:00 2001 From: Andrei Date: Wed, 15 Mar 2017 23:31:46 -0700 Subject: [PATCH] Add GuildMember.modify --- disco/api/client.py | 2 +- disco/types/guild.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/disco/api/client.py b/disco/api/client.py index c0f90ea..0c00539 100644 --- a/disco/api/client.py +++ b/disco/api/client.py @@ -240,7 +240,7 @@ class APIClient(LoggingClass): return GuildMember.create(self.client, r.json(), guild_id=guild) def guilds_members_modify(self, guild, member, **kwargs): - self.http(Routes.GUILDS_MEMBERS_MODIFY, dict(guild=guild, member=member), json=kwargs) + self.http(Routes.GUILDS_MEMBERS_MODIFY, dict(guild=guild, member=member), json=optional(**kwargs)) def guilds_members_roles_add(self, guild, member, role): self.http(Routes.GUILDS_MEMBERS_ROLES_ADD, dict(guild=guild, member=member, role=role)) diff --git a/disco/types/guild.py b/disco/types/guild.py index f7f71c9..b478cd9 100644 --- a/disco/types/guild.py +++ b/disco/types/guild.py @@ -200,6 +200,9 @@ class GuildMember(SlottedModel): else: self.client.api.guilds_members_modify(self.guild.id, self.user.id, nick=nickname or '') + def modify(self, **kwargs): + self.client.api.guilds_members_modify(self.guild.id, self.user.id, **kwargs) + def add_role(self, role): self.client.api.guilds_members_roles_add(self.guild.id, self.user.id, to_snowflake(role))