Data models
This section explains data models used in topggpy to represent data received from Top.gg.
Note
All listed models subclass dict
and allow retrieving data via attributes and keys (i.e., both response['id']
and response.id
are valid).
DataDict
- class topgg.types.DataDict(**kwargs: topgg.types.VT)[source]
Bases:
dict
,MutableMapping
[topgg.types.KT
,topgg.types.VT
]Base class used to represent received data from the API.
Every data model subclasses this class.
BotData
UserData
BriefUserData
BotStatsData
- class topgg.types.BotStatsData(**kwargs: Any)[source]
Bases:
topgg.types.DataDict
[str
,Any
]Model that contains information about a listed bot’s guild and shard count.
VoteDataDict
- class topgg.types.VoteDataDict(**kwargs: Any)[source]
Bases:
topgg.types.DataDict
[str
,Any
]Base model that represents received information from Top.gg via webhooks.
- query: topgg.types.DataDict
Query parameters in DataDict.
BotVoteData
ServerVoteData
- class topgg.types.ServerVoteData(**kwargs: Any)[source]
Bases:
topgg.types.VoteDataDict
Model that contains information about a server vote.
WidgetOptions
- class topgg.types.WidgetOptions(id: Optional[int] = None, format: Optional[str] = None, type: Optional[str] = None, noavatar: bool = False, colors: Optional[Dict[str, int]] = None, colours: Optional[Dict[str, int]] = None)[source]
Bases:
topgg.types.DataDict
[str
,Any
]Model that represents widget options that are passed to Top.gg widget URL generated via
DBLClient.generate_widget()
.- id: Optional[int]
ID of a bot to generate the widget for. Must resolve to an ID of a listed bot when converted to a string.
- colors: Dict[str, int]
A dictionary consisting of a parameter as a key and HEX color (type int) as value.
color
will be appended to the key in case it doesn’t end withcolor
.
SocialData
Bases:
topgg.types.DataDict
[str
,str
]Model that contains social information about a top.gg user.
The YouTube channel ID of the user.
The Reddit username of the user.
The Twitter username of the user.
The Instagram username of the user.
The GitHub username of the user.