Skip to content

fix(TopGG): use authentication on every method #180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 23, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 31 additions & 31 deletions docs/general/services.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<a href="https://arcane-center.xyz"><h1>Arcane Bot List</h1></a>

Keys: `arcane`, `arcane-center.xyz`
Class: [dbots.Arcane](/#/docs/main/master/class/Arcane)
Class: [dbots.Arcane](/#/docs/main/U-topgg/class/Arcane)
Website: https://arcane-center.xyz
</div>

Expand All @@ -22,7 +22,7 @@ Website: https://arcane-center.xyz
<a href="https://botlists.com"><h1>Astro Bot List</h1></a>

Keys: `astrobotlist`, `botlists.com`
Class: [dbots.AstroBotList](/#/docs/main/master/class/AstroBotList)
Class: [dbots.AstroBotList](/#/docs/main/U-topgg/class/AstroBotList)
Website: https://botlists.com
</div>

Expand All @@ -35,7 +35,7 @@ Website: https://botlists.com
<a href="https://bladebotlist.xyz"><h1>BladeBotList</h1></a>

Keys: `bladebotlist`, `bladebotlist.xyz`
Class: [dbots.BladeBotList](/#/docs/main/master/class/BladeBotList)
Class: [dbots.BladeBotList](/#/docs/main/U-topgg/class/BladeBotList)
Website: https://bladebotlist.xyz
</div>

Expand All @@ -48,7 +48,7 @@ Website: https://bladebotlist.xyz
<a href="https://blist.xyz"><h1>Blist</h1></a>

Keys: `blist`, `blist.xyz`
Class: [dbots.Blist](/#/docs/main/master/class/Blist)
Class: [dbots.Blist](/#/docs/main/U-topgg/class/Blist)
Website: https://blist.xyz
</div>

Expand All @@ -61,7 +61,7 @@ Website: https://blist.xyz
<a href="https://botlist.space"><h1>botlist.space</h1></a>

Keys: `botlistspace`, `botlist.space`
Class: [dbots.BotListSpace](/#/docs/main/master/class/BotListSpace)
Class: [dbots.BotListSpace](/#/docs/main/U-topgg/class/BotListSpace)
Website: https://botlist.space
</div>

Expand All @@ -74,7 +74,7 @@ Website: https://botlist.space
<a href="https://botsdatabase.com"><h1>BotsDataBase</h1></a>

Keys: `botsdatabase`, `botsdatabase.com`
Class: [dbots.BotsDataBase](/#/docs/main/master/class/BotsDataBase)
Class: [dbots.BotsDataBase](/#/docs/main/U-topgg/class/BotsDataBase)
Website: https://botsdatabase.com
</div>

Expand All @@ -87,7 +87,7 @@ Website: https://botsdatabase.com
<a href="https://botsfordiscord.com"><h1>Bots For Discord</h1></a>

Keys: `botsfordiscord`, `botsfordiscord.com`
Class: [dbots.BotsForDiscord](/#/docs/main/master/class/BotsForDiscord)
Class: [dbots.BotsForDiscord](/#/docs/main/U-topgg/class/BotsForDiscord)
Website: https://botsfordiscord.com
</div>

Expand All @@ -100,7 +100,7 @@ Website: https://botsfordiscord.com
<a href="https://bots.ondiscord.xyz"><h1>Bots On Discord</h1></a>

Keys: `botsondiscord`, `bots.ondiscord.xyz`
Class: [dbots.BotsOnDiscord](/#/docs/main/master/class/BotsOnDiscord)
Class: [dbots.BotsOnDiscord](/#/docs/main/U-topgg/class/BotsOnDiscord)
Website: https://bots.ondiscord.xyz
</div>

Expand All @@ -114,7 +114,7 @@ Website: https://bots.ondiscord.xyz
<a href="https://www.carbonitex.net/Discord/bots"><h1>Carbonitex</h1></a>

Keys: `carbonitex`, `carbonitex.net`, `carbon`
Class: [dbots.Carbon](/#/docs/main/master/class/Carbon)
Class: [dbots.Carbon](/#/docs/main/U-topgg/class/Carbon)
Website: https://www.carbonitex.net/Discord/bots
</div>

Expand All @@ -127,7 +127,7 @@ Website: https://www.carbonitex.net/Discord/bots
<a href="https://dbots.co/"><h1>DBots.co</h1></a>

Keys: `dbots`, `dbots.co`
Class: [dbots.DBots](/#/docs/main/master/class/DBots)
Class: [dbots.DBots](/#/docs/main/U-topgg/class/DBots)
Website: https://dbots.co/
</div>

Expand All @@ -140,7 +140,7 @@ Website: https://dbots.co/
<a href="https://discordapps.dev"><h1>Discord Apps</h1></a>

Keys: `discordappsdev`, `discordapps.dev`
Class: [dbots.DiscordAppsDev](/#/docs/main/master/class/DiscordAppsDev)
Class: [dbots.DiscordAppsDev](/#/docs/main/U-topgg/class/DiscordAppsDev)
Website: https://discordapps.dev
</div>

Expand All @@ -153,7 +153,7 @@ Website: https://discordapps.dev
<a href="https://discord.boats"><h1>Discord Boats</h1></a>

Keys: `discordboats`, `discord.boats`
Class: [dbots.DiscordBoats](/#/docs/main/master/class/DiscordBoats)
Class: [dbots.DiscordBoats](/#/docs/main/U-topgg/class/DiscordBoats)
Website: https://discord.boats
</div>

Expand All @@ -166,7 +166,7 @@ Website: https://discord.boats
<a href="https://discordbotdirectory.net"><h1>Discord Bot Directory</h1></a>

Keys: `discordbotdirectory`, `discordbotdirectory.net`
Class: [dbots.DiscordBotDirectory](/#/docs/main/master/class/DiscordBotDirectory)
Class: [dbots.DiscordBotDirectory](/#/docs/main/U-topgg/class/DiscordBotDirectory)
Website: https://discordbotdirectory.net
</div>

Expand All @@ -179,7 +179,7 @@ Website: https://discordbotdirectory.net
<a href="https://discordbotlist.com"><h1>Discord Bot List</h1></a>

Keys: `discordbotlist`, `discordbotlist.com`
Class: [dbots.DiscordBotList](/#/docs/main/master/class/DiscordBotList)
Class: [dbots.DiscordBotList](/#/docs/main/U-topgg/class/DiscordBotList)
Website: https://discordbotlist.com
</div>

Expand All @@ -192,7 +192,7 @@ Website: https://discordbotlist.com
<a href="https://discordbots.co"><h1>DiscordBots.co</h1></a>

Keys: `discordbotsco`, `discordbots.co`
Class: [dbots.DiscordBotsCo](/#/docs/main/master/class/DiscordBotsCo)
Class: [dbots.DiscordBotsCo](/#/docs/main/U-topgg/class/DiscordBotsCo)
Website: https://discordbots.co
</div>

Expand All @@ -205,7 +205,7 @@ Website: https://discordbots.co
<a href="https://discord.bots.gg"><h1>Discord Bots</h1></a>

Keys: `discordbotsgg`, `discord.bots.gg`
Class: [dbots.DiscordBotsGG](/#/docs/main/master/class/DiscordBotsGG)
Class: [dbots.DiscordBotsGG](/#/docs/main/U-topgg/class/DiscordBotsGG)
Website: https://discord.bots.gg
</div>

Expand All @@ -218,7 +218,7 @@ Website: https://discord.bots.gg
<a href="https://discordextremelist.xyz/"><h1>Discord Extreme List</h1></a>

Keys: `discordextremelist`, `discordextremelist.xyz`
Class: [dbots.DiscordExtremeList](/#/docs/main/master/class/DiscordExtremeList)
Class: [dbots.DiscordExtremeList](/#/docs/main/U-topgg/class/DiscordExtremeList)
Website: https://discordextremelist.xyz/
</div>

Expand All @@ -231,7 +231,7 @@ Website: https://discordextremelist.xyz/
<a href="https://bots.discordlabs.org/"><h1>Discord Labs</h1></a>

Keys: `discordlabs`, `discordlabs.org`
Class: [dbots.DiscordLabs](/#/docs/main/master/class/DiscordLabs)
Class: [dbots.DiscordLabs](/#/docs/main/U-topgg/class/DiscordLabs)
Website: https://bots.discordlabs.org/
</div>

Expand All @@ -244,7 +244,7 @@ Website: https://bots.discordlabs.org/
<a href="https://discordlistology.com/"><h1>DiscordListology</h1></a>

Keys: `discordlistology`, `discordlistology.com`
Class: [dbots.DiscordListology](/#/docs/main/master/class/DiscordListology)
Class: [dbots.DiscordListology](/#/docs/main/U-topgg/class/DiscordListology)
Website: https://discordlistology.com/
</div>

Expand All @@ -257,7 +257,7 @@ Website: https://discordlistology.com/
<a href="https://discordservices.net"><h1>Discord Services</h1></a>

Keys: `discordservices`, `discordservices.net`
Class: [dbots.DiscordServices](/#/docs/main/master/class/DiscordServices)
Class: [dbots.DiscordServices](/#/docs/main/U-topgg/class/DiscordServices)
Website: https://discordservices.net
</div>

Expand All @@ -270,7 +270,7 @@ Website: https://discordservices.net
<a href="https://disforge.com/bots"><h1>Disforge</h1></a>

Keys: `disforge`, `disforge.com`
Class: [dbots.Disforge](/#/docs/main/master/class/Disforge)
Class: [dbots.Disforge](/#/docs/main/U-topgg/class/Disforge)
Website: https://disforge.com/bots
</div>

Expand All @@ -283,7 +283,7 @@ Website: https://disforge.com/bots
<a href="https://glennbotlist.xyz"><h1>Glenn Bot List</h1></a>

Keys: `glennbotlist`, `glennbotlist.xyz`
Class: [dbots.GlennBotList](/#/docs/main/master/class/GlennBotList)
Class: [dbots.GlennBotList](/#/docs/main/U-topgg/class/GlennBotList)
Website: https://glennbotlist.xyz
</div>

Expand All @@ -296,7 +296,7 @@ Website: https://glennbotlist.xyz
<a href="https://infinitybots.xyz"><h1>Infinity Bot List</h1></a>

Keys: `infinitybots`, `infinitybots.xyz`
Class: [dbots.InfinityBots](/#/docs/main/master/class/InfinityBots)
Class: [dbots.InfinityBots](/#/docs/main/U-topgg/class/InfinityBots)
Website: https://infinitybots.xyz
</div>

Expand All @@ -309,7 +309,7 @@ Website: https://infinitybots.xyz
<a href="https://listmybots.com/"><h1>List My Bots</h1></a>

Keys: `listmybots`, `listmybots.com`
Class: [dbots.ListMyBots](/#/docs/main/master/class/ListMyBots)
Class: [dbots.ListMyBots](/#/docs/main/U-topgg/class/ListMyBots)
Website: https://listmybots.com/
</div>

Expand All @@ -322,7 +322,7 @@ Website: https://listmybots.com/
<a href="https://paradisebots.net/"><h1>Paradise Bots</h1></a>

Keys: `paradisebots`, `paradisebots.net`
Class: [dbots.ParadiseBots](/#/docs/main/master/class/ParadiseBots)
Class: [dbots.ParadiseBots](/#/docs/main/U-topgg/class/ParadiseBots)
Website: https://paradisebots.net/
</div>

Expand All @@ -335,7 +335,7 @@ Website: https://paradisebots.net/
<a href="https://space-bot-list.xyz/"><h1>Space Bots List</h1></a>

Keys: `spacebotslist`, `space-bot-list.xyz`
Class: [dbots.SpaceBotsList](/#/docs/main/master/class/SpaceBotsList)
Class: [dbots.SpaceBotsList](/#/docs/main/U-topgg/class/SpaceBotsList)
Website: https://space-bot-list.xyz/
</div>

Expand All @@ -348,7 +348,7 @@ Website: https://space-bot-list.xyz/
<a href="https://topcord.xyz/"><h1>TopCord</h1></a>

Keys: `topcord`, `topcord.xyz`
Class: [dbots.TopCord](/#/docs/main/master/class/TopCord)
Class: [dbots.TopCord](/#/docs/main/U-topgg/class/TopCord)
Website: https://topcord.xyz/
</div>

Expand All @@ -361,7 +361,7 @@ Website: https://topcord.xyz/
<a href="https://top.gg"><h1>Top.gg</h1></a>

Keys: `topgg`, `top.gg`
Class: [dbots.TopGG](/#/docs/main/master/class/TopGG)
Class: [dbots.TopGG](/#/docs/main/U-topgg/class/TopGG)
Website: https://top.gg
</div>

Expand All @@ -374,7 +374,7 @@ Website: https://top.gg
<a href="https://voidbots.net/"><h1>Void Bots</h1></a>

Keys: `voidbots`, `voidbots.net`
Class: [dbots.VoidBots](/#/docs/main/master/class/VoidBots)
Class: [dbots.VoidBots](/#/docs/main/U-topgg/class/VoidBots)
Website: https://voidbots.net/
</div>

Expand All @@ -387,7 +387,7 @@ Website: https://voidbots.net/
<a href="https://wonderbotlist.com/en"><h1>Wonder Bot List</h1></a>

Keys: `wonderbotlist`, `wonderbotlist.com`
Class: [dbots.WonderBotList](/#/docs/main/master/class/WonderBotList)
Class: [dbots.WonderBotList](/#/docs/main/U-topgg/class/WonderBotList)
Website: https://wonderbotlist.com/en
</div>

Expand All @@ -400,6 +400,6 @@ Website: https://wonderbotlist.com/en
<a href="https://yabl.xyz/"><h1>Yet Another Bot List</h1></a>

Keys: `yabl`, `yabl.xyz`
Class: [dbots.YABL](/#/docs/main/master/class/YABL)
Class: [dbots.YABL](/#/docs/main/U-topgg/class/YABL)
Website: https://yabl.xyz/
</div>
9 changes: 4 additions & 5 deletions lib/Interface/Lists/TopGG.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default class TopGG extends Service {
*/
getUser(id: IDResolvable): Promise<import("axios").AxiosResponse<any>>;
/**
* Gets the list of bots on this service.
* Gets the a of bots on this service that match your query (refer to Top.gg docs for query parameters).
* @param query The query string that will be used in the request
*/
getBots(query: Query): Promise<import("axios").AxiosResponse<any>>;
Expand All @@ -44,15 +44,14 @@ export default class TopGG extends Service {
/**
* Gets the list of people who voted this bot on this service.
* @param id The bot's ID
* @param query The query string that will be used in the request
*/
getBotVotes(id: IDResolvable, query?: Query): Promise<import("axios").AxiosResponse<any>>;
getBotVotes(id: IDResolvable): Promise<import("axios").AxiosResponse<any>>;
/**
* Checks whether or not a user has voted for a bot on this service.
* @param id The bot's ID
* @param botId The bot's ID
* @param userID The user's ID
*/
userVoted(id: IDResolvable, userID: IDResolvable): Promise<import("axios").AxiosResponse<any>>;
userVoted(botId: IDResolvable, userID: IDResolvable): Promise<import("axios").AxiosResponse<any>>;
/**
* Gets the widget URL for this bot.
* @param id The bot's ID
Expand Down
37 changes: 23 additions & 14 deletions lib/Interface/Lists/TopGG.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,50 +88,59 @@ var TopGG = /** @class */ (function (_super) {
* @param id The user's ID
*/
TopGG.prototype.getUser = function (id) {
return this._request({ url: "/users/" + Util_1.Util.resolveID(id) });
return this._request({
url: "/users/" + Util_1.Util.resolveID(id),
headers: { Authorization: this.token }
}, { requiresToken: true });
};
/**
* Gets the list of bots on this service.
* Gets the a of bots on this service that match your query (refer to Top.gg docs for query parameters).
* @param query The query string that will be used in the request
*/
TopGG.prototype.getBots = function (query) {
return this._request({ url: '/bots', params: query });
return this._request({ url: '/bots', params: query, headers: { Authorization: this.token } }, { requiresToken: true });
};
/**
* Gets the bot listed on this service.
* @param id The bot's ID
*/
TopGG.prototype.getBot = function (id) {
return this._request({ url: "/bots/" + Util_1.Util.resolveID(id) });
return this._request({
url: "/bots/" + Util_1.Util.resolveID(id),
headers: { Authorization: this.token }
}, { requiresToken: true });
};
/**
* Gets the bot's stats listed on this service.
* @param id The bot's ID
*/
TopGG.prototype.getBotStats = function (id) {
return this._request({ url: "/bots/" + Util_1.Util.resolveID(id) + "/stats" });
return this._request({
url: "/bots/" + Util_1.Util.resolveID(id) + "/stats",
headers: { Authorization: this.token }
}, { requiresToken: true });
};
/**
* Gets the list of people who voted this bot on this service.
* @param id The bot's ID
* @param query The query string that will be used in the request
*/
TopGG.prototype.getBotVotes = function (id, query) {
TopGG.prototype.getBotVotes = function (id) {
return this._request({
url: "/bots/" + Util_1.Util.resolveID(id) + "/votes",
params: query
});
headers: { Authorization: this.token }
}, { requiresToken: true });
};
/**
* Checks whether or not a user has voted for a bot on this service.
* @param id The bot's ID
* @param botId The bot's ID
* @param userID The user's ID
*/
TopGG.prototype.userVoted = function (id, userID) {
TopGG.prototype.userVoted = function (botId, userID) {
return this._request({
url: "/bots/" + Util_1.Util.resolveID(id) + "/check",
params: { userId: Util_1.Util.resolveID(userID) }
});
url: "/bots/" + Util_1.Util.resolveID(botId) + "/check",
params: { userId: Util_1.Util.resolveID(userID) },
headers: { Authorization: this.token }
}, { requiresToken: true });
};
/**
* Gets the widget URL for this bot.
Expand Down
Loading