aboutsummaryrefslogtreecommitdiff
path: root/discord/team.py
diff options
context:
space:
mode:
authorSebbyLaw <[email protected]>2020-10-04 05:41:29 -0700
committerRapptz <[email protected]>2020-11-21 21:11:47 -0500
commit2e2560126fb924d558c9df3f92162eda4de46323 (patch)
treefffc3eee715cf2296b35f903aa3ba3e9e8ecb1c5 /discord/team.py
parentTranslation sync with crowdin (diff)
downloaddiscord.py-2e2560126fb924d558c9df3f92162eda4de46323.tar.xz
discord.py-2e2560126fb924d558c9df3f92162eda4de46323.zip
Implement icon_rl_as and cover_image_url_as for AppInfo
Diffstat (limited to 'discord/team.py')
-rw-r--r--discord/team.py35
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):