Browse Source

Bugs found in testing and code review (#143)

* Patch get_icon_url

Nice try, but don't copy+paste without testing whomever PR'd this 😉

* Patch status in update_presence payload

No more Enum, no more `.value`
pull/144/head
Dooley_labs 6 years ago
committed by Andrei Zbikowski
parent
commit
70ed08c7f5
  1. 2
      disco/client.py
  2. 4
      disco/types/guild.py

2
disco/client.py

@ -131,7 +131,7 @@ class Client(LoggingClass):
payload = {
'afk': afk,
'since': since,
'status': status.value.lower(),
'status': status.lower(),
'game': None,
}

4
disco/types/guild.py

@ -528,9 +528,9 @@ class Guild(SlottedModel, Permissible):
if fmt is not None:
return 'https://cdn.discordapp.com/icons/{}/{}.{}?size={}'.format(self.id, self.icon, fmt, size)
if self.icon.startswith('a_'):
return 'https://cdn.discordapp.com/avatars/{}/{}.gif?size={}'.format(self.id, self.icon, size)
return 'https://cdn.discordapp.com/icons/{}/{}.gif?size={}'.format(self.id, self.icon, size)
else:
return 'https://cdn.discordapp.com/avatars/{}/{}.webp?size={}'.format(self.id, self.icon, size)
return 'https://cdn.discordapp.com/icons/{}/{}.webp?size={}'.format(self.id, self.icon, size)
def get_splash_url(self, fmt='webp', size=1024):
if not self.splash:

Loading…
Cancel
Save