Browse Source

Apply suggestions from code review

Co-Authored-By: Andrei Zbikowski <[email protected]>
pull/153/head
Faster Speeding 6 years ago
committed by GitHub
parent
commit
23fa9a40d7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      disco/api/client.py
  2. 2
      disco/gateway/client.py
  3. 2
      disco/types/guild.py

6
disco/api/client.py

@ -437,7 +437,7 @@ class APIClient(LoggingClass):
r = self.http(Routes.GUILDS_PRUNE_COUNT, dict(guild=guild), params=optional(days=days)) r = self.http(Routes.GUILDS_PRUNE_COUNT, dict(guild=guild), params=optional(days=days))
return PruneCount.create(self.client, r.json()) return PruneCount.create(self.client, r.json())
def guilds_prune(self, guild, days=None, compute_prune_count=None): def guilds_prune_create(self, guild, days=None, compute_prune_count=None):
r = self.http(Routes.GUILDS_PRUNE_BEGIN, dict(guild=guild), params=optional( r = self.http(Routes.GUILDS_PRUNE_BEGIN, dict(guild=guild), params=optional(
days=days, days=days,
compute_prune_count=compute_prune_count, compute_prune_count=compute_prune_count,
@ -504,7 +504,7 @@ class APIClient(LoggingClass):
def guilds_roles_delete(self, guild, role, reason=None): def guilds_roles_delete(self, guild, role, reason=None):
self.http(Routes.GUILDS_ROLES_DELETE, dict(guild=guild, role=role), headers=_reason_header(reason)) self.http(Routes.GUILDS_ROLES_DELETE, dict(guild=guild, role=role), headers=_reason_header(reason))
def guilds_regions_list(self, guild): def guilds_voice_regions_list(self, guild):
r = self.http(Routes.GUILDS_VOICE_REGIONS_LIST, dict(guild=guild)) r = self.http(Routes.GUILDS_VOICE_REGIONS_LIST, dict(guild=guild))
return VoiceRegion.create_hash(self.client, 'id', r.json()) return VoiceRegion.create_hash(self.client, 'id', r.json())
@ -592,7 +592,7 @@ class APIClient(LoggingClass):
r = self.http(Routes.INVITES_DELETE, dict(invite=invite), headers=_reason_header(reason)) r = self.http(Routes.INVITES_DELETE, dict(invite=invite), headers=_reason_header(reason))
return Invite.create(self.client, r.json()) return Invite.create(self.client, r.json())
def regions_list(self): def voice_regions_list(self):
r = self.http(Routes.VOICE_REGIONS_LIST) r = self.http(Routes.VOICE_REGIONS_LIST)
return VoiceRegion.create_hash(self.client, 'id', r.json()) return VoiceRegion.create_hash(self.client, 'id', r.json())

2
disco/gateway/client.py

@ -214,7 +214,7 @@ class GatewayClient(LoggingClass):
'token': self.client.config.token, 'token': self.client.config.token,
'compress': True, 'compress': True,
'large_threshold': 250, 'large_threshold': 250,
'guild_subscriptions': bool(self.client.config.guild_subscriptions), 'guild_subscriptions': self.client.config.guild_subscriptions,
'shard': [ 'shard': [
int(self.client.config.shard_id), int(self.client.config.shard_id),
int(self.client.config.shard_count), int(self.client.config.shard_count),

2
disco/types/guild.py

@ -533,7 +533,7 @@ class Guild(SlottedModel, Permissible):
def get_emoji(self, emoji): def get_emoji(self, emoji):
return self.client.api.guilds_emojis_get(self.id, emoji) return self.client.api.guilds_emojis_get(self.id, emoji)
def get_regions(self): def get_voice_regions(self):
return self.client.api.guilds_regions_list(self.id) return self.client.api.guilds_regions_list(self.id)
def get_icon_url(self, still_format='webp', animated_format='gif', size=1024): def get_icon_url(self, still_format='webp', animated_format='gif', size=1024):

Loading…
Cancel
Save