Achievement
Represents a Discord achievement created at Developer portal.
Attributes
int
The achievement's respective application's id.
str
The description of the achievement.
None
, dict
of (str
, str
) itemsLocalized descriptions of the achievement.
int
The achievement's icon's hash. Achievements always have icon.
The achievement's icon's type.
int
The achievement's unique identifier number.
str
The name of the achievement.
None
, dict
of (str
, str
) itemsLocalized names of the achievement.
bool
Secret achievements will *not* be shown to the user until they've unlocked them.
bool
Secure achievements can only be set via HTTP calls from your server, not by a game client using the SDK.
Properties
created_at
When the entity was created.
Returns
created_at : datetime
icon
icon_url
Returns the achievement's icon's url.
This function is a shared property of Achievement
-s.
Returns
url : None
, str
Methods
(data)
__init__Creates an achievement with the given data.
Parameter | Type | Description |
---|---|---|
data |
| Received achievement data. |
(...)
icon_url_asReturns the achievement's icon's url.
This function is a shared method of Achievement
-s.
Parameter | Type | Optional | Default | Description |
---|---|---|---|---|
ext |
|
| The extension of the icon's url. Can be any of: | |
size |
|
| The preferred minimal size of the icon's url. |
Returns
url : None
, str
Raises
ValueError
If ext
, size
was not passed as any of the expected values.
(data)
_difference_update_attributesUpdates the achievement and returns it's overwritten attributes as a dict
with a attribute-name
- old-value
relation.
Parameter | Type | Description |
---|---|---|
data |
| Achievement data received from Discord. |
Returns
old_attributes : dict
of (str
, object
) items
All item in the returned dict is optional.
Returned Data Structure
Keys | Values |
---|---|
description | str |
description_localizations | None , dict of (str , str ) items |
icon | Icon |
name | str |
name_localizations | None , dict of (str , str ) items |
secret | bool |
secure | bool |
(data)
_update_attributesUpdates the achievement with overwriting it's old attributes.
Parameter | Type | Description |
---|---|---|
data |
| Achievement data received from Discord. |
()
__eq__Whether this entity's id is equal as the other's.
()
__format__Formats the achievement with the given format code.
()
__ge__Whether this entity's id is greater or equal than the other's.
()
__getattr__Drops a rich attribute error.
()
__gt__Whether this entity's id is greater than the other's.
()
__hash__Returns the has value of the entity, what equals to it's id.
()
__le__Whether this entity's id is less or equal than the other's.
()
__lt__Whether this entity's id is less than the other's.
()
__ne__Whether this entity's id is not equal as the other's.
()
__repr__Returns the achievement's representation.