Model Reference
This page will document every model that is returned, and used, by toppy.
Warning
These objects should not be manually created by users.
- class toppy.models.Bot(**kwargs)
Model representing a top.gg bot
This also conforms with the discord user ABC. See: toppy.models.User
- Attributes:
- id:
int The bot’s ID
- discriminator:
str The bot’s discriminator (prefixed with #)
- username:
str the bot’s username
- avatar:
str The bot’s avatar hash
- user_avatar: Optional[
str] The bot’s custom avatar hash
- default_avatar:
str The bot’s default avatar hash
- prefix:
str The bot’s prefix
- short_description:
str The bot’s short description on top.gg
- long_description:
str The bot’s long description on top.gg
- tags:
py:List`[:class:`py:str] A list of tags the bot uses on top.gg
- website: Optional[
str] The bot’s website. Can be None.
- support: Optional[
str] The bots support server URL. Can be None
- github: Optional[
str] The bot’s github repo page URL. Can be None.
- owners:
py:List`[:class:`py:int] A list of owner IDs that own this bot.
- featured_guilds:
py:List`[:class:`py:int] A list of featured guild IDs that are used on the bot’s top.gg page
- invite:
str The bot’s invite URL
Danger
This URL is not always a discord.com URL. If you are making requests to it, just be aware.
- approved_at:
datetime.datetime The datetime that this bot was approved at on top.gg
Note
This can sometimes fail to resolve the given timestamp, and defaults to
datetime.datetime.min.- certified:
bool Boolean indicating if this bot is certified on top.gg
- vanity_uri: Optional[
str] This bot’s vanity endpoint on top.gg
- all_time_votes:
int The total number of votes this bot received the entire time it has been on top.gg
- monthly_votes:
int The total number of votes the bot got this month
- donations_guild: Optional[py:int]
The server ID for donations using donatebot
- id:
- class toppy.models.User(**kwargs)
Model representing a top.gg user’s account.
This class conforms to the discord.User ABC.
Warning
For some reason, top.gg just randomly omits fields that it shouldn’t according to their docs. As such, any or all fields here may be None.
- property socials: Socials
An object containing the user’s social links.
- property avatar_url: str
This returns the user’s resolved avatar URL.
If the user doesn’t have an avatar, this will return their default one.
- property colour: Colour
The user’s preferred navigation colour.
There is an alias for this under toppy.models.User.color
- Returns
discord.Colour - the resolved colour
- Return type
- user(state=None) Optional[User]
Gets the current discord user object from the top.gg user object.
state can be the bot/client instance, or anything with a get_user method.
- Return type
Optional[
discord.User]
- class toppy.models.SimpleUser(**kwargs)
A model representing the “simple user” object returned by /bots/{id}/votes.
- class toppy.models.BotStats(**kwargs)
Model representing 3 fields from /bot/{id}/stats