mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-06 09:56:09 +00:00
Adjust BASE urls to have no trailing slash (consistency)
This commit is contained in:
@ -63,7 +63,7 @@ class Asset:
|
||||
"""
|
||||
__slots__ = ('_state', '_url')
|
||||
|
||||
BASE = 'https://cdn.discordapp.com/'
|
||||
BASE = 'https://cdn.discordapp.com'
|
||||
|
||||
def __init__(self, state, url=None):
|
||||
self._state = state
|
||||
@ -86,14 +86,14 @@ class Asset:
|
||||
if format is None:
|
||||
format = 'gif' if user.is_avatar_animated() else static_format
|
||||
|
||||
return cls(state, 'avatars/{0.id}/{0.avatar}.{1}?size={2}'.format(user, format, size))
|
||||
return cls(state, '/avatars/{0.id}/{0.avatar}.{1}?size={2}'.format(user, format, size))
|
||||
|
||||
@classmethod
|
||||
def _from_icon(cls, state, object, path):
|
||||
if object.icon is None:
|
||||
return cls(state)
|
||||
|
||||
url = '{0}-icons/{1.id}/{1.icon}.jpg'.format(path, object)
|
||||
url = '/{0}-icons/{1.id}/{1.icon}.jpg'.format(path, object)
|
||||
return cls(state, url)
|
||||
|
||||
@classmethod
|
||||
@ -101,7 +101,7 @@ class Asset:
|
||||
if obj.cover_image is None:
|
||||
return cls(state)
|
||||
|
||||
url = 'app-assets/{0.id}/store/{0.cover_image}.jpg'.format(obj)
|
||||
url = '/app-assets/{0.id}/store/{0.cover_image}.jpg'.format(obj)
|
||||
return cls(state, url)
|
||||
|
||||
@classmethod
|
||||
@ -114,7 +114,7 @@ class Asset:
|
||||
if hash is None:
|
||||
return cls(state)
|
||||
|
||||
url = '{key}/{0}/{1}.{2}?size={3}'
|
||||
url = '/{key}/{0}/{1}.{2}?size={3}'
|
||||
return cls(state, url.format(id, hash, format, size, key=key))
|
||||
|
||||
@classmethod
|
||||
@ -134,7 +134,7 @@ class Asset:
|
||||
if format is None:
|
||||
format = 'gif' if guild.is_icon_animated() else static_format
|
||||
|
||||
return cls(state, 'icons/{0.id}/{0.icon}.{1}?size={2}'.format(guild, format, size))
|
||||
return cls(state, '/icons/{0.id}/{0.icon}.{1}?size={2}'.format(guild, format, size))
|
||||
|
||||
|
||||
def __str__(self):
|
||||
|
Reference in New Issue
Block a user