File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -1654,6 +1654,18 @@ async def get_all_members(self) -> List[Member]:
16541654
16551655 return [Member (** _ , _client = self ._client ) for _ in _all_members ]
16561656
1657+ @property
1658+ def icon_url (self ) -> str :
1659+ """
1660+ Returns the URL of the guild's icon.
1661+ :return: URL of the guild's icon (None will be returned if none of icon is set)
1662+ :rtype: str
1663+ """
1664+ if self .icon is not None :
1665+ url = f"https://cdn.discordapp.com/icons/{ int (self .id )} /{ self .icon } "
1666+ url += ".gif" if self .icon .startswith ("a_" ) else ".png"
1667+ return url
1668+
16571669
16581670class GuildPreview (DictSerializerMixin ):
16591671 """
Original file line number Diff line number Diff line change @@ -413,6 +413,8 @@ class Guild(DictSerializerMixin):
413413 limit : Optional [int ] = 1
414414 ) -> List [Member ]: ...
415415 async def get_all_members (self ) -> List [Member ]: ...
416+ @property
417+ def icon_url (self ) -> str : ...
416418
417419class GuildPreview (DictSerializerMixin ):
418420 _json : dict
You can’t perform that action at this time.
0 commit comments