Create Top.gg API instance
Token or options
Optional
options: APIOptions = {}API Options
Get a list of bots
// Finding by properties
await api.getBots({
search: {
username: "shiro",
certifiedBot: true,
},
});
// =>
{
results: [
{
id: '461521980492087297',
username: 'Shiro',
discriminator: '8764',
lib: 'discord.js',
...rest of bot object
}
...other shiro knockoffs B)
],
limit: 10,
offset: 0,
count: 1,
total: 1
}
// Restricting fields
await api.getBots({
fields: ["id", "username"],
});
// =>
{
results: [
{
id: '461521980492087297',
username: 'Shiro'
},
{
id: '493716749342998541',
username: 'Mimu'
},
...
],
...
}
Return response
Optional
query: BotsQueryBot Query
Get users who've voted
await api.getVotes();
// =>
[
{
username: 'Xignotic',
discriminator: '0001',
id: '205680187394752512',
avatar: '3b9335670c7213b3a2d4e990081900c7'
},
{
username: 'iara',
discriminator: '0001',
id: '395526710101278721',
avatar: '3d1477390b8d7c3cec717ac5c778f5f4'
}
...more
]
Array of users who've voted
Generated using TypeDoc
Top.gg API Client for Posting stats or Fetching data
Example
Link
Library docs
Link
API Reference