Avatars
Implementations for the avatars
endpoint.
Avatars ¶
Bases: HTTPAwareEndpoint
A class with implementations for the avatars
endpoint.
check_avatar
async
¶
check_avatar(avatar: str | bytes, threshold: float = 0.97, method: Literal['ssim', 'phash'] = 'phash') -> CheckAvatarResponse
Check if avatar is fraudulent.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
avatar
|
str | bytes
|
Link to the avatar, should start with "cdn.discordapp.com" or the avatar to query, as an octet stream. |
required |
threshold
|
float = 0.97
|
How similar the avatar needs to be for it to match (0-1, default 0.97). |
0.97
|
method
|
Literal['ssim', 'phash']
|
Which method to use for matching the avatars ("ssim" or "phash", default is "phash"). |
'phash'
|
Raises:
Type | Description |
---|---|
TypeError
|
If any parameters are of invalid types. |
ValueError
|
If any parameters are invalid values. |
Returns:
Type | Description |
---|---|
CheckAvatarResponse
|
A model response from |