-
Notifications
You must be signed in to change notification settings - Fork 1
Guide
Pum edited this page Apr 3, 2021
·
4 revisions
There are three end points of the API currently:
async def get_profile():
wrapper = tatsu.wrapper.ApiWrapper(key=APIKEY)
result = await wrapper.get_profile(user_id)
return resultThis will return a user profile object with the following structure:
| Field | Type | Description |
|---|---|---|
| avatar_hash | str | The avatar hash of the user. |
| avatar_url | str | The avatar url of the user. |
| credis | int | The amount of credits the user has. |
| discriminator | str | The user's discriminator. |
| user_id | int | The user ID |
| info_box | str | The users current info box |
| reputation | int | The number of reputation points the user has |
| subscription_type | int | The users subscription type. See below for more information |
| subscription_renewal | datetime | A datetime object representing the next renewal time for the users supporter. |
| title | str | The title of the profile card |
| tokens | int | The amount of tokens a user has |
| username | str | The user's username |
| xp | int | The amount of xp the user currently has |
| original | dict | The original response of the API |
| Value | Description |
|---|---|
| 0 | No subscription |
| 1 | Supporter |
| 2 | Supporter+ |
| 3 | Supporter++ |
Note: The renewal will be a year 0 datetime object if the user is not a supporter.
async def get_member_ranking():
wrapper = tatsu.wrapper.ApiWrapper(key=APIKEY)
result = await wrapper.get_member_ranking(server_id, user_id)
return resultThis returns the members ranking object with the following structure:
| Field | Type | Description |
|---|---|---|
| guild_id | int | The discord ID of the guild |
| rank | int | The user's rank |
| user_id | int | The user ID |
| score | int | The user's score |
| original | dict | The original response of the API |
async def get_guild_rankings():
wrapper = tatsu.wrapper.ApiWrapper(key=APIKEY)
result = await wrapper.get_guild_rankings(guild_id, timeframe="month", offset=0) #
return resultThe default value for offset is 0 The default value for timeframe is all but it can also be month or week
This returns a guild rank object with the following structure:
| Field | Type | Description |
|---|---|---|
| guild_id | int | The discord ID of the guild |
| Rankings | [RankingObject] | A list of user rank objects (maximum 100) |
| original | dict | The original response of the API |