Objects

User

class amari.objects.User(guild_id: int, data: dict, position: Optional[int] = None, *, leaderboard: Optional[Leaderboard] = None)[source]

An Amari user.

guild_id

The user’s guild ID.

Type

int

user_id

The user’s ID.

Type

int

name

The user’s Discord username. This may not be up to date.

Type

str

exp

The user’s experience points.

Type

int

level

The user’s level.

Type

Optional[int]

weeklyexp

The user’s weekly experience points.

Type

Optional[int]

position

The user’s position in the leaderboard.

Type

Optional[int]

leaderboard

The leaderboard object the user is in, if a leaderboard endpoint was fetched.

Type

Optional[Leaderboard]

Users

class amari.objects.Users(guild_id: int, data: dict)[source]

An object which holds multiple users.

guild_id

The guild ID.

Type

int

users

The list of users.

Type

Dict[int, User]

total_members

The amount of users in the list.

Type

int

queried_members

The amount of users requested.

Type

int

add_user(user: User, /) Users[source]

Add a user to the users.

Parameters

user (User) – The user to add.

Returns

The object of users the user was added to, for fluent class chaining.

Return type

Users

get_user(user_id: int, /) Optional[User][source]

Get a user from the users object.

Parameters

user_id (int) – The user’s ID.

Returns

The user, if found in the users.

Return type

Optional[User]

Leaderboard

class amari.objects.Leaderboard(guild_id: int, data: dict)[source]

An Amari leaderboard.

guild_id

The guild ID.

Type

int

user_count

The number of users in the leaderboard.

Type

int

total_count

The total number of users on Amari’s API in this leaderboard.

Type

Optional[int]

users

The users in the leaderboard.

Type

Dict[int, User]

add_user(user: User, /) Leaderboard[source]

Add a user to the leaderboard.

Parameters

user (User) – The user to add.

Returns

The leaderboard the user was added to, for fluent class chaining.

Return type

Leaderboard

get_user(user_id: int, /) Optional[User][source]

Get a user from the leaderboard.

Parameters

user_id (int) – The user’s ID.

Returns

The user, if found in the leaderboard.

Return type

Optional[User]

Rewards

class amari.objects.Rewards(guild_id: int, data: dict)[source]

A collection of Amari reward roles.

guild_id

The guild ID.

Type

int

reward_count

The number of reward roles.

Type

int

roles

The guild’s reward roles.

Type

Dict[int, RewardRole]

get_role(role_id: int, /) Optional[RewardRole][source]

Get a reward role from the rewards.

Parameters

role_id (int) – The role’s ID.

Returns

The role, if found in the rewards.

Return type

Optional[RewardRole]

Rewards Role

class amari.objects.RewardRole(role_id: int, level: int, rewards: Rewards)[source]

An object representing an Amari reward role.

role_id

The role’s ID.

Type

int

level

The level that a user needs for the role to be awarded to them.

Type

int

rewards

The rewards object this role belongs to.

Type

Rewards