Appearance
discohook.asset
Classes
Asset
discohook.asset.Asset
Represents a Discord asset. This is used internally by the library. You should not need to use this.
Arguments
- hash (
str): The hash of the asset. - fragment (
str): The fragment of the asset.
Property Index
Method Index
Properties
default
Checks if the asset is a default avatar.
Returns
- Type:
bool- Whether the asset is a default avatar.
dynamic
Checks if the asset is animated or not.
Returns
- Type:
bool- Whether the asset is animated.
url
Constructs the URL of the asset in its default size with .webp format.
Returns
- Type:
str- The URL of the asset in its default size with
.webpformat.
- The URL of the asset in its default size with
Methods
url_as
python
url_as(self, *, format: str = 'png', size: int = 1024) -> strConstructs the URL of the asset in the specified size and format.
Arguments
- format (
str): The format of the asset. - size (
int): The size of the asset.
Returns
- Type:
str- The URL of the asset in the specified size and format.
