Return None when guild has no icon

This commit is contained in:
thecosmos
2019-05-22 10:57:21 +05:30
parent 00a3eff7e8
commit 480fdc556e

View File

@@ -32,5 +32,7 @@ class Guild(object):
@property
def icon_url(self):
"""A property returning direct URL to the guild's icon."""
"""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)