AmariClient
- class amari.api.AmariClient(token: str, /, *, useAntirateLimit: bool = True, session: Optional[ClientSession] = None)[source]
The client used to make requests to the Amari API.
- useAntiRatelimit
Whether to use the anti ratelimit or not. IT IS VERY UNRECOMMENDED TO DISABLE THIS FEATURE AS IT CAN LEAD TO RATELIMITS
- Type
bool
- session
The client session used to make requests to the Amari API.
- Type
aiohttp.ClientSession
- async close()[source]
Closes the client resources.
This must be called once the client is no longer in use.
- async fetch_full_leaderboard(guild_id: int, /, *, weekly: bool = False) Leaderboard [source]
Fetches a guild’s full leaderboard from the Amari API.
- Parameters
guild_id (int) – The guild ID to fetch the leaderboard from.
weekly (bool) – Choose either to fetch the weekly leaderboard or the regular leaderboard.
- Returns
The guild’s leaderboard.
- Return type
- async fetch_leaderboard(guild_id: int, /, *, weekly: bool = False, raw: bool = False, page: Optional[int] = None, limit: Optional[int] = None) Leaderboard [source]
Fetches a guild’s leaderboard from the Amari API.
- Parameters
guild_id (int) – The guild ID to fetch the leaderboard from.
weekly (bool) – Choose either to fetch the weekly leaderboard or the regular leaderboard.
raw (bool) – Whether or not to use the raw endpoint. Raw endpoints do not support pagination but will return the entire leaderboard.
page (int) – The leaderboard page to fetch.
limit (int) – The amount of users to fetch per page.
- Returns
The guild’s leaderboard.
- Return type
- async fetch_rewards(guild_id: int, /, *, page: int = 1, limit: int = 50) Rewards [source]
Fetches a guild’s role rewards from the Amari API.
- Parameters
guild_id (int) – The guild ID to fetch the role rewards from.
page (int) – The rewards page to fetch.
limit (int) – The amount of rewards to fetch per page.
- Returns
The guild’s role rewards.
- Return type