mirror of
https://github.com/yawaflua/Flask-Discord.git
synced 2025-12-10 04:19:31 +02:00
Prefix all configs with DISCORD_ to prevent un intended user override
This commit is contained in:
@@ -37,4 +37,4 @@ class Guild(DiscordModelsBase):
|
||||
"""A property returning direct URL to the guild's icon. Returns None if guild has no icon set."""
|
||||
if not self.icon_hash:
|
||||
return
|
||||
return configs.GUILD_ICON_BASE_URL.format(guild_id=self.id, icon_hash=self.icon_hash)
|
||||
return configs.DISCORD_GUILD_ICON_BASE_URL.format(guild_id=self.id, icon_hash=self.icon_hash)
|
||||
|
||||
@@ -60,8 +60,10 @@ class User(DiscordModelsBase):
|
||||
@property
|
||||
def avatar_url(self):
|
||||
"""A property returning direct URL to user's avatar."""
|
||||
image_format = configs.ANIMATED_IMAGE_FORMAT if self.is_avatar_animated else configs.IMAGE_FORMAT
|
||||
return configs.USER_AVATAR_BASE_URL.format(user_id=self.id, avatar_hash=self.avatar_hash, format=image_format)
|
||||
image_format = configs.DISCORD_ANIMATED_IMAGE_FORMAT \
|
||||
if self.is_avatar_animated else configs.DISCORD_IMAGE_FORMAT
|
||||
return configs.DISCORD_USER_AVATAR_BASE_URL.format(
|
||||
user_id=self.id, avatar_hash=self.avatar_hash, format=image_format)
|
||||
|
||||
@property
|
||||
def is_avatar_animated(self):
|
||||
|
||||
Reference in New Issue
Block a user