Titles: Achievements - Seluj78/IntraPy GitHub Wiki
If you need to get the corresponding achievement(s) for a given title, you've came to the right page !
With the achievement section on our title handler, you'll be able to do just that !
First and foremost, import it:
from IntraPy.title_handler.achievements import Titles
Once done, get_achievements
will be available to you.
def get_achievements(self, title_id, **options):
# Where title_id is the title you want to get the achievements from
# and options are the options you want to pass to get_achievements
Disclaimer: This function is named like others in other handlers. Don't mix them !
Then, this function is really simple to use. It will return to you the achievement(s) in a json form:
[{'id': XXX, 'name': 'XXX', 'description': 'XXX', 'tier': 'XXX', 'kind': 'XXX', 'visible': XXX, 'image': 'XXX', 'nbr_of_success': XXX, 'users_url': 'XXX', 'achievements': [], 'parent': XXX, 'title': XXX}, {'id': XXX, 'name': 'XXX', 'description': 'XXX', 'tier': 'XXX', 'kind': 'XXX', 'visible': XXX, 'image': 'XXX', 'nbr_of_success': XXX, 'users_url': 'XXX', 'achievements': [], 'parent': XXX, 'title': XXX}, {'id': XXX, 'name': 'XXX', 'description': 'XXX', 'tier': 'XXX', 'kind': 'XXX', 'visible': XXX, 'image': 'XXX', 'nbr_of_success': XXX, 'users_url': 'XXX', 'achievements': [], 'parent': XXX, 'title': XXX} ...]
Or, with pretty=True
:
[
{
"achievements": [],
"description": "XXX",
"id": 1,
"image": "XXX",
"kind": "XXX",
"name": "XXX",
"nbr_of_success": XXX,
"parent": XXX,
"tier": "XXX",
"title": XXX,
"users_url": "XXX,
"visible": XXX
},
{
"achievements": [],
"description": "XXX",
"id": XXX,
"image": "XXX",
"kind": "XXX",
"name": "XXX",
"nbr_of_success": XXX,
"parent": XXX,
"tier": "XXX",
"title": XXX,
"users_url": "XXX",
"visible": XXX
},
{
"achievements": [],
"description": "XXX",
"id": XXX,
"image": "XXX",
"kind": "XXX",
"name": "XXX",
"nbr_of_success": XXX,
"parent": XXX,
"tier": "XXX",
"title": XXX,
"users_url": "XXX",
"visible": XXX
},
...
]
Here's an example to get you started:
from IntraPy.title_handler.achievements import Titles
titles = Titles()
print(titles.get_achievements(7))