AmariClient
- class amari.api.AmariClient(token: str, /, *, useAntirateLimit: bool = True, session: Optional[aiohttp.client.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) amari.objects.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) amari.objects.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) amari.objects.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
- async fetch_user(guild_id: int, user_id: int) amari.objects.User [source]
Fetches a user from the Amari API.
- Parameters
guild_id (int) – The guild ID to fetch the user from.
user_id (int) – The user’s ID.
- async fetch_users(guild_id: int, user_ids: List[int]) amari.objects.Users [source]
Fetches multiple users from the Amari API.
- Parameters
guild_id (int) – The guild ID to fetch the user from.
user_ids (List[int]) – The IDs of the users you would like to fetch.