From 966fa0f3ae937d175c9c1b7f0236fdba25255f66 Mon Sep 17 00:00:00 2001 From: Luke Date: Sat, 4 May 2019 01:49:43 +0100 Subject: [PATCH] removed "return User.create(self.client, r.json())" from guilds_members_add due to lack of json response when user already in guild and switched name to mandatory arg in guilds_create --- disco/api/client.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/disco/api/client.py b/disco/api/client.py index 50d690f..f14dcd5 100644 --- a/disco/api/client.py +++ b/disco/api/client.py @@ -293,7 +293,7 @@ class APIClient(LoggingClass): def guilds_create( self, - name=None, + name, region=None, icon=None, verification_level=None, @@ -302,7 +302,11 @@ class APIClient(LoggingClass): roles=None, channels=None): - r = self.http(Routes.GUILDS_CREATE, json=optional( + payload = { + 'name': name + } + + payload.update(optional( name=name, region=region, icon=icon, @@ -312,6 +316,8 @@ class APIClient(LoggingClass): roles=roles, channels=channels )) + + r = self.http(Routes.GUILDS_CREATE, json=payload) return Guild.create(self.client, r.json()) def guilds_channels_list(self, guild): @@ -404,7 +410,6 @@ class APIClient(LoggingClass): )) r = self.http(Routes.GUILDS_MEMBERS_ADD, dict(guild=guild, member=member), json=payload) - return User.create(self.client, r.json()) def guilds_members_kick(self, guild, member, reason=None): self.http(Routes.GUILDS_MEMBERS_KICK, dict(guild=guild, member=member), headers=_reason_header(reason))