Prefix all configs with DISCORD_ to prevent un intended user override

This commit is contained in:
thecosmos
2020-04-14 08:46:55 +05:30
parent dd2df8ac0b
commit 03952f66f9
5 changed files with 23 additions and 24 deletions

View File

@@ -1,24 +1,21 @@
API_BASE_URL = "https://discordapp.com/api"
DISCORD_API_BASE_URL = "https://discordapp.com/api"
AUTHORIZATION_BASE_URL = API_BASE_URL + "/oauth2/authorize"
TOKEN_URL = API_BASE_URL + "/oauth2/token"
DISCORD_AUTHORIZATION_BASE_URL = DISCORD_API_BASE_URL + "/oauth2/authorize"
DISCORD_TOKEN_URL = DISCORD_API_BASE_URL + "/oauth2/token"
ALL_SCOPES = [
DISCORD_OAUTH_ALL_SCOPES = [
"bot", "connections", "email", "identify", "guilds", "guilds.join",
"gdm.join", "messages.read", "rpc", "rpc.api", "rpc.notifications.read", "webhook.incoming",
]
DEFAULT_SCOPES = [
DISCORD_OAUTH_DEFAULT_SCOPES = [
"identify", "email", "guilds", "guilds.join"
]
IMAGE_BASE_URL = "https://cdn.discordapp.com/"
IMAGE_FORMAT = "png"
ANIMATED_IMAGE_FORMAT = "gif"
USER_AVATAR_BASE_URL = IMAGE_BASE_URL + "avatars/{user_id}/{avatar_hash}.{format}"
GUILD_ICON_BASE_URL = IMAGE_BASE_URL + "icons/{guild_id}/{icon_hash}.png"
# TODO: Prefix configs with DISCORD_ to avoid users overriding it with their own configs.
DISCORD_IMAGE_BASE_URL = "https://cdn.discordapp.com/"
DISCORD_IMAGE_FORMAT = "png"
DISCORD_ANIMATED_IMAGE_FORMAT = "gif"
DISCORD_USER_AVATAR_BASE_URL = DISCORD_IMAGE_BASE_URL + "avatars/{user_id}/{avatar_hash}.{format}"
DISCORD_GUILD_ICON_BASE_URL = DISCORD_IMAGE_BASE_URL + "icons/{guild_id}/{icon_hash}.png"