Return invites as https, various URL normalization

This commit is contained in:
Devon R
2019-11-14 21:37:23 +00:00
committed by Rapptz
parent 46246a2844
commit f5ebf42e1f
8 changed files with 23 additions and 18 deletions

View File

@ -586,7 +586,7 @@ class Webhook:
"""
if self.avatar is None:
# Default is always blurple apparently
return Asset(self._state, 'https://cdn.discordapp.com/embed/avatars/0.png')
return Asset(self._state, 'embed/avatars/0.png')
if not utils.valid_icon_size(size):
raise InvalidArgument("size must be a power of 2 between 16 and 1024")
@ -596,7 +596,7 @@ class Webhook:
if format not in ('png', 'jpg', 'jpeg'):
raise InvalidArgument("format must be one of 'png', 'jpg', or 'jpeg'.")
url = 'https://cdn.discordapp.com/avatars/{0.id}/{0.avatar}.{1}?size={2}'.format(self, format, size)
url = 'avatars/{0.id}/{0.avatar}.{1}?size={2}'.format(self, format, size)
return Asset(self._state, url)
def delete(self):