Add ValueError to PartialEmoji.read docstring

This commit is contained in:
Steve C 2022-04-19 01:25:11 -04:00 committed by GitHub
parent 2e02f618f0
commit fd5886a058
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -233,6 +233,26 @@ class PartialEmoji(_EmojiTag, AssetMixin):
return f'{Asset.BASE}/emojis/{self.id}.{fmt}'
async def read(self) -> bytes:
"""|coro|
Retrieves the content of this asset as a :class:`bytes` object.
Raises
------
DiscordException
There was no internal connection state.
HTTPException
Downloading the asset failed.
NotFound
The asset was deleted.
ValueError
The PartialEmoji is not a custom emoji.
Returns
-------
:class:`bytes`
The content of the asset.
"""
if self.is_unicode_emoji():
raise ValueError('PartialEmoji is not a custom emoji')