Rewards¶
gd.py has interface that allows fetching chests and quests:
Example:
client = gd.Client()
await client.login("user", "password") # must be logged in
chests = await client.get_chests()
# [<Chest id=... orbs=... diamonds=... shard_id=... shard_type=... keys=... count=... delta=h:m:s>, ...]
quests = await client.get_quests()
# [<Quest id=... name=... type=... amount=... reward=... delta=h:m:s>, ...]
Chest¶
-
class
gd.Chest(**options)[source]¶ Class that represents reward chests in Geometry Dash. This class is derived from
AbstractEntity.-
x == y Check if two objects are equal. Compared by hash and type.
-
x != y Check if two objects are not equal.
-
str(x) Return human-readable representation of the chest, like
Chest; count: 13, new in 00:00:42.000000.
-
repr(x) Return representation of the chest, useful for debugging.
-
hash(x) Returns
hash(self.hash_str).
-
classmethod
from_model(model: gd.model.ChestModel, *, client: Optional[Client] = None, count: int = 0, seconds: int = 0) → Chest[source]¶ Create new entity from given
model,argsandkwargs.
-
property
delta¶ Amount of seconds until next chest, wrapped in delta.
- Type
-
property
ready_at¶ Timestamp after which the chest can be opened.
- Type
-
attach_client(client: Optional[Client] = None) → AbstractEntityT¶ Attach
clienttoself.- Parameters
client (Optional[
gd.Client]) – Client to attach. IfNoneor not given, will be detached.- Returns
This abstract entity.
- Return type
-
property
client¶ Client attached to this object. This checks if client is not present, and raises
ClientExceptionin that case.- Type
-
detach_client() → AbstractEntityT¶ Detach
clientfromself.Same as calling:
self.attach_client(None)
- Returns
This abstract entity.
- Return type
-
classmethod
from_dict(*data: Dict[str, Any], client: Optional[Client] = None, **kwargs) → AbstractEntityT¶ Create new entity from dictionaries in
data, withclientandkwargs.
-
classmethod
from_dicts(*data: Dict[str, Any], client: Optional[Client] = None, **kwargs) → AbstractEntityT¶ Create new entity from dictionaries in
data, withclientandkwargs.
-
classmethod
from_models(*models: gd.model_backend.Model, **kwargs) → AbstractEntityT¶ Create new entity from given
modelsby callingfrom_modelwithkwargs.
-
update_inner(**options: Any) → AbstractEntityT¶ Update
self.optionswithoptions.
-
Quest¶
-
class
gd.Quest(**kwargs)[source]¶ Class that represents quests, or challenges, in Geometry Dash. This class is derived from
AbstractEntity.-
x == y Check if two objects are equal. Compared by hash and type.
-
x != y Check if two objects are not equal.
-
str(x) Return human-readable representation of the quest, like
Quest Name; collect: 100 orbs, reward: 10, new in 00:00:13.000000.
-
repr(x) Return representation of the quest, useful for debugging.
-
hash(x) Returns
hash(self.hash_str).
-
classmethod
from_model(model: gd.model.QuestModel, *, client: Optional[Client] = None, seconds: int = 0) → Quest[source]¶ Create new entity from given
model,argsandkwargs.
-
property
delta¶ Delta until next quest pack.
- Type
-
property
new_at¶ datetime.datetimeTimestamp after which next quest pack can be fetched.
-
attach_client(client: Optional[Client] = None) → AbstractEntityT¶ Attach
clienttoself.- Parameters
client (Optional[
gd.Client]) – Client to attach. IfNoneor not given, will be detached.- Returns
This abstract entity.
- Return type
-
property
client¶ Client attached to this object. This checks if client is not present, and raises
ClientExceptionin that case.- Type
-
detach_client() → AbstractEntityT¶ Detach
clientfromself.Same as calling:
self.attach_client(None)
- Returns
This abstract entity.
- Return type
-
classmethod
from_dict(*data: Dict[str, Any], client: Optional[Client] = None, **kwargs) → AbstractEntityT¶ Create new entity from dictionaries in
data, withclientandkwargs.
-
classmethod
from_dicts(*data: Dict[str, Any], client: Optional[Client] = None, **kwargs) → AbstractEntityT¶ Create new entity from dictionaries in
data, withclientandkwargs.
-
classmethod
from_models(*models: gd.model_backend.Model, **kwargs) → AbstractEntityT¶ Create new entity from given
modelsby callingfrom_modelwithkwargs.
-
update_inner(**options: Any) → AbstractEntityT¶ Update
self.optionswithoptions.
-