diff options
Diffstat (limited to 'discord/team.py')
| -rw-r--r-- | discord/team.py | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/discord/team.py b/discord/team.py index 0afb6458..94b00a2e 100644 --- a/discord/team.py +++ b/discord/team.py @@ -68,8 +68,39 @@ class Team: @property def icon_url(self): - """:class:`.Asset`: Retrieves the team's icon asset.""" - return Asset._from_icon(self._state, self, 'team') + """:class:`.Asset`: Retrieves the team's icon asset. + + This is equivalent to calling :meth:`icon_url_as` with + the default parameters ('webp' format and a size of 1024). + """ + return self.icon_url_as() + + def icon_url_as(self, *, format='None', size=1024): + """Returns an :class:`Asset` for the icon the team has. + + The format must be one of 'webp', 'jpeg', 'jpg' or 'png'. + The size must be a power of 2 between 16 and 4096. + + .. versionadded:: 2.0 + + Parameters + ----------- + format: :class:`str` + The format to attempt to convert the icon to. Defaults to 'webp'. + size: :class:`int` + The size of the image to display. + + Raises + ------ + InvalidArgument + Bad image format passed to ``format`` or invalid ``size``. + + Returns + -------- + :class:`Asset` + The resulting CDN asset. + """ + return Asset._from_icon(self._state, self, 'team', format=format, size=size) @property def owner(self): |