diff --git a/docs/general/services.md b/docs/general/services.md index acecbcdb..0ba8c135 100644 --- a/docs/general/services.md +++ b/docs/general/services.md @@ -8,8 +8,8 @@

Arcane Bot List

-Keys: `arcane`, `arcane-center.xyz` -Class: [dbots.Arcane](/#/docs/main/master/class/Arcane) +Keys: `arcane`, `arcane-center.xyz` +Class: [dbots.Arcane](/#/docs/main/U-topgg/class/Arcane) Website: https://arcane-center.xyz @@ -21,8 +21,8 @@ Website: https://arcane-center.xyz

Astro Bot List

-Keys: `astrobotlist`, `botlists.com` -Class: [dbots.AstroBotList](/#/docs/main/master/class/AstroBotList) +Keys: `astrobotlist`, `botlists.com` +Class: [dbots.AstroBotList](/#/docs/main/U-topgg/class/AstroBotList) Website: https://botlists.com @@ -34,8 +34,8 @@ Website: https://botlists.com

BladeBotList

-Keys: `bladebotlist`, `bladebotlist.xyz` -Class: [dbots.BladeBotList](/#/docs/main/master/class/BladeBotList) +Keys: `bladebotlist`, `bladebotlist.xyz` +Class: [dbots.BladeBotList](/#/docs/main/U-topgg/class/BladeBotList) Website: https://bladebotlist.xyz @@ -47,8 +47,8 @@ Website: https://bladebotlist.xyz

Blist

-Keys: `blist`, `blist.xyz` -Class: [dbots.Blist](/#/docs/main/master/class/Blist) +Keys: `blist`, `blist.xyz` +Class: [dbots.Blist](/#/docs/main/U-topgg/class/Blist) Website: https://blist.xyz @@ -60,8 +60,8 @@ Website: https://blist.xyz

botlist.space

-Keys: `botlistspace`, `botlist.space` -Class: [dbots.BotListSpace](/#/docs/main/master/class/BotListSpace) +Keys: `botlistspace`, `botlist.space` +Class: [dbots.BotListSpace](/#/docs/main/U-topgg/class/BotListSpace) Website: https://botlist.space @@ -73,8 +73,8 @@ Website: https://botlist.space

BotsDataBase

-Keys: `botsdatabase`, `botsdatabase.com` -Class: [dbots.BotsDataBase](/#/docs/main/master/class/BotsDataBase) +Keys: `botsdatabase`, `botsdatabase.com` +Class: [dbots.BotsDataBase](/#/docs/main/U-topgg/class/BotsDataBase) Website: https://botsdatabase.com @@ -86,8 +86,8 @@ Website: https://botsdatabase.com

Bots For Discord

-Keys: `botsfordiscord`, `botsfordiscord.com` -Class: [dbots.BotsForDiscord](/#/docs/main/master/class/BotsForDiscord) +Keys: `botsfordiscord`, `botsfordiscord.com` +Class: [dbots.BotsForDiscord](/#/docs/main/U-topgg/class/BotsForDiscord) Website: https://botsfordiscord.com @@ -99,8 +99,8 @@ Website: https://botsfordiscord.com

Bots On Discord

-Keys: `botsondiscord`, `bots.ondiscord.xyz` -Class: [dbots.BotsOnDiscord](/#/docs/main/master/class/BotsOnDiscord) +Keys: `botsondiscord`, `bots.ondiscord.xyz` +Class: [dbots.BotsOnDiscord](/#/docs/main/U-topgg/class/BotsOnDiscord) Website: https://bots.ondiscord.xyz @@ -113,8 +113,8 @@ Website: https://bots.ondiscord.xyz

Carbonitex

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

DBots.co

-Keys: `dbots`, `dbots.co` -Class: [dbots.DBots](/#/docs/main/master/class/DBots) +Keys: `dbots`, `dbots.co` +Class: [dbots.DBots](/#/docs/main/U-topgg/class/DBots) Website: https://dbots.co/ @@ -139,8 +139,8 @@ Website: https://dbots.co/

Discord Apps

-Keys: `discordappsdev`, `discordapps.dev` -Class: [dbots.DiscordAppsDev](/#/docs/main/master/class/DiscordAppsDev) +Keys: `discordappsdev`, `discordapps.dev` +Class: [dbots.DiscordAppsDev](/#/docs/main/U-topgg/class/DiscordAppsDev) Website: https://discordapps.dev @@ -152,8 +152,8 @@ Website: https://discordapps.dev

Discord Boats

-Keys: `discordboats`, `discord.boats` -Class: [dbots.DiscordBoats](/#/docs/main/master/class/DiscordBoats) +Keys: `discordboats`, `discord.boats` +Class: [dbots.DiscordBoats](/#/docs/main/U-topgg/class/DiscordBoats) Website: https://discord.boats @@ -165,8 +165,8 @@ Website: https://discord.boats

Discord Bot Directory

-Keys: `discordbotdirectory`, `discordbotdirectory.net` -Class: [dbots.DiscordBotDirectory](/#/docs/main/master/class/DiscordBotDirectory) +Keys: `discordbotdirectory`, `discordbotdirectory.net` +Class: [dbots.DiscordBotDirectory](/#/docs/main/U-topgg/class/DiscordBotDirectory) Website: https://discordbotdirectory.net @@ -178,8 +178,8 @@ Website: https://discordbotdirectory.net

Discord Bot List

-Keys: `discordbotlist`, `discordbotlist.com` -Class: [dbots.DiscordBotList](/#/docs/main/master/class/DiscordBotList) +Keys: `discordbotlist`, `discordbotlist.com` +Class: [dbots.DiscordBotList](/#/docs/main/U-topgg/class/DiscordBotList) Website: https://discordbotlist.com @@ -191,8 +191,8 @@ Website: https://discordbotlist.com

DiscordBots.co

-Keys: `discordbotsco`, `discordbots.co` -Class: [dbots.DiscordBotsCo](/#/docs/main/master/class/DiscordBotsCo) +Keys: `discordbotsco`, `discordbots.co` +Class: [dbots.DiscordBotsCo](/#/docs/main/U-topgg/class/DiscordBotsCo) Website: https://discordbots.co @@ -204,8 +204,8 @@ Website: https://discordbots.co

Discord Bots

-Keys: `discordbotsgg`, `discord.bots.gg` -Class: [dbots.DiscordBotsGG](/#/docs/main/master/class/DiscordBotsGG) +Keys: `discordbotsgg`, `discord.bots.gg` +Class: [dbots.DiscordBotsGG](/#/docs/main/U-topgg/class/DiscordBotsGG) Website: https://discord.bots.gg @@ -217,8 +217,8 @@ Website: https://discord.bots.gg

Discord Extreme List

-Keys: `discordextremelist`, `discordextremelist.xyz` -Class: [dbots.DiscordExtremeList](/#/docs/main/master/class/DiscordExtremeList) +Keys: `discordextremelist`, `discordextremelist.xyz` +Class: [dbots.DiscordExtremeList](/#/docs/main/U-topgg/class/DiscordExtremeList) Website: https://discordextremelist.xyz/ @@ -230,8 +230,8 @@ Website: https://discordextremelist.xyz/

Discord Labs

-Keys: `discordlabs`, `discordlabs.org` -Class: [dbots.DiscordLabs](/#/docs/main/master/class/DiscordLabs) +Keys: `discordlabs`, `discordlabs.org` +Class: [dbots.DiscordLabs](/#/docs/main/U-topgg/class/DiscordLabs) Website: https://bots.discordlabs.org/ @@ -243,8 +243,8 @@ Website: https://bots.discordlabs.org/

DiscordListology

-Keys: `discordlistology`, `discordlistology.com` -Class: [dbots.DiscordListology](/#/docs/main/master/class/DiscordListology) +Keys: `discordlistology`, `discordlistology.com` +Class: [dbots.DiscordListology](/#/docs/main/U-topgg/class/DiscordListology) Website: https://discordlistology.com/ @@ -256,8 +256,8 @@ Website: https://discordlistology.com/

Discord Services

-Keys: `discordservices`, `discordservices.net` -Class: [dbots.DiscordServices](/#/docs/main/master/class/DiscordServices) +Keys: `discordservices`, `discordservices.net` +Class: [dbots.DiscordServices](/#/docs/main/U-topgg/class/DiscordServices) Website: https://discordservices.net @@ -269,8 +269,8 @@ Website: https://discordservices.net

Disforge

-Keys: `disforge`, `disforge.com` -Class: [dbots.Disforge](/#/docs/main/master/class/Disforge) +Keys: `disforge`, `disforge.com` +Class: [dbots.Disforge](/#/docs/main/U-topgg/class/Disforge) Website: https://disforge.com/bots @@ -282,8 +282,8 @@ Website: https://disforge.com/bots

Glenn Bot List

-Keys: `glennbotlist`, `glennbotlist.xyz` -Class: [dbots.GlennBotList](/#/docs/main/master/class/GlennBotList) +Keys: `glennbotlist`, `glennbotlist.xyz` +Class: [dbots.GlennBotList](/#/docs/main/U-topgg/class/GlennBotList) Website: https://glennbotlist.xyz @@ -295,8 +295,8 @@ Website: https://glennbotlist.xyz

Infinity Bot List

-Keys: `infinitybots`, `infinitybots.xyz` -Class: [dbots.InfinityBots](/#/docs/main/master/class/InfinityBots) +Keys: `infinitybots`, `infinitybots.xyz` +Class: [dbots.InfinityBots](/#/docs/main/U-topgg/class/InfinityBots) Website: https://infinitybots.xyz @@ -308,8 +308,8 @@ Website: https://infinitybots.xyz

List My Bots

-Keys: `listmybots`, `listmybots.com` -Class: [dbots.ListMyBots](/#/docs/main/master/class/ListMyBots) +Keys: `listmybots`, `listmybots.com` +Class: [dbots.ListMyBots](/#/docs/main/U-topgg/class/ListMyBots) Website: https://listmybots.com/ @@ -321,8 +321,8 @@ Website: https://listmybots.com/

Paradise Bots

-Keys: `paradisebots`, `paradisebots.net` -Class: [dbots.ParadiseBots](/#/docs/main/master/class/ParadiseBots) +Keys: `paradisebots`, `paradisebots.net` +Class: [dbots.ParadiseBots](/#/docs/main/U-topgg/class/ParadiseBots) Website: https://paradisebots.net/ @@ -334,8 +334,8 @@ Website: https://paradisebots.net/

Space Bots List

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

TopCord

-Keys: `topcord`, `topcord.xyz` -Class: [dbots.TopCord](/#/docs/main/master/class/TopCord) +Keys: `topcord`, `topcord.xyz` +Class: [dbots.TopCord](/#/docs/main/U-topgg/class/TopCord) Website: https://topcord.xyz/ @@ -360,8 +360,8 @@ Website: https://topcord.xyz/

Top.gg

-Keys: `topgg`, `top.gg` -Class: [dbots.TopGG](/#/docs/main/master/class/TopGG) +Keys: `topgg`, `top.gg` +Class: [dbots.TopGG](/#/docs/main/U-topgg/class/TopGG) Website: https://top.gg @@ -373,8 +373,8 @@ Website: https://top.gg

Void Bots

-Keys: `voidbots`, `voidbots.net` -Class: [dbots.VoidBots](/#/docs/main/master/class/VoidBots) +Keys: `voidbots`, `voidbots.net` +Class: [dbots.VoidBots](/#/docs/main/U-topgg/class/VoidBots) Website: https://voidbots.net/ @@ -386,8 +386,8 @@ Website: https://voidbots.net/

Wonder Bot List

-Keys: `wonderbotlist`, `wonderbotlist.com` -Class: [dbots.WonderBotList](/#/docs/main/master/class/WonderBotList) +Keys: `wonderbotlist`, `wonderbotlist.com` +Class: [dbots.WonderBotList](/#/docs/main/U-topgg/class/WonderBotList) Website: https://wonderbotlist.com/en @@ -399,7 +399,7 @@ Website: https://wonderbotlist.com/en

Yet Another Bot List

-Keys: `yabl`, `yabl.xyz` -Class: [dbots.YABL](/#/docs/main/master/class/YABL) +Keys: `yabl`, `yabl.xyz` +Class: [dbots.YABL](/#/docs/main/U-topgg/class/YABL) Website: https://yabl.xyz/ \ No newline at end of file diff --git a/lib/Interface/Lists/TopGG.d.ts b/lib/Interface/Lists/TopGG.d.ts index a4797696..2333d600 100644 --- a/lib/Interface/Lists/TopGG.d.ts +++ b/lib/Interface/Lists/TopGG.d.ts @@ -3,7 +3,7 @@ import { IDResolvable } from '../../Utils/Util'; import { Query } from '../../Utils/Constants'; /** * Represents the Top.gg service. - * @see https://top.gg/api/docs + * @see https://docs.top.gg/ */ export default class TopGG extends Service { /** The values that can be used to select the service. */ @@ -27,7 +27,7 @@ export default class TopGG extends Service { */ getUser(id: IDResolvable): Promise>; /** - * 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>; @@ -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>; + getBotVotes(id: IDResolvable): Promise>; /** * 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>; + userVoted(botId: IDResolvable, userID: IDResolvable): Promise>; /** * Gets the widget URL for this bot. * @param id The bot's ID diff --git a/lib/Interface/Lists/TopGG.js b/lib/Interface/Lists/TopGG.js index 5b0f607f..adf53c49 100644 --- a/lib/Interface/Lists/TopGG.js +++ b/lib/Interface/Lists/TopGG.js @@ -17,7 +17,7 @@ var Service_1 = require("../Service"); var Util_1 = require("../../Utils/Util"); /** * Represents the Top.gg service. - * @see https://top.gg/api/docs + * @see https://docs.top.gg/ */ var TopGG = /** @class */ (function (_super) { __extends(TopGG, _super); @@ -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. diff --git a/scripts/docs.ts b/scripts/docs.ts index 442b20ea..b6609e11 100644 --- a/scripts/docs.ts +++ b/scripts/docs.ts @@ -44,10 +44,12 @@ for (const filename of listClasses) { ${aliases.map((key: string) => ``).join('\n ')}

${serviceName}

-Keys: ${aliases.map((key: string) => `\`${key}\``).join(', ')} +Keys: ${aliases.map((key: string) => `\`${key}\``).join(', ')}${ + ' ' /* This is just to avoid prettier deleting the spaces*/ + } Class: [dbots.${className}](${ ref ? `/#/docs/main/${ref}/class/${className}` : '' - }) + })${' '} Website: ${websiteURL} ` } diff --git a/src/Interface/Lists/TopGG.ts b/src/Interface/Lists/TopGG.ts index 55db8d25..78948e58 100644 --- a/src/Interface/Lists/TopGG.ts +++ b/src/Interface/Lists/TopGG.ts @@ -4,7 +4,7 @@ import { Query } from '../../Utils/Constants' /** * Represents the Top.gg service. - * @see https://top.gg/api/docs + * @see https://docs.top.gg/ */ export default class TopGG extends Service { /** The values that can be used to select the service. */ @@ -57,15 +57,24 @@ export default class TopGG extends Service { * @param id The user's ID */ getUser(id: IDResolvable) { - return this._request({ url: `/users/${Util.resolveID(id)}` }) + return this._request( + { + url: `/users/${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 */ getBots(query: Query) { - return this._request({ url: '/bots', params: query }) + return this._request( + { url: '/bots', params: query, headers: { Authorization: this.token } }, + { requiresToken: true } + ) } /** @@ -73,7 +82,13 @@ export default class TopGG extends Service { * @param id The bot's ID */ getBot(id: IDResolvable) { - return this._request({ url: `/bots/${Util.resolveID(id)}` }) + return this._request( + { + url: `/bots/${Util.resolveID(id)}`, + headers: { Authorization: this.token } + }, + { requiresToken: true } + ) } /** @@ -81,31 +96,43 @@ export default class TopGG extends Service { * @param id The bot's ID */ getBotStats(id: IDResolvable) { - return this._request({ url: `/bots/${Util.resolveID(id)}/stats` }) + return this._request( + { + url: `/bots/${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 */ - getBotVotes(id: IDResolvable, query?: Query) { - return this._request({ - url: `/bots/${Util.resolveID(id)}/votes`, - params: query - }) + getBotVotes(id: IDResolvable) { + return this._request( + { + url: `/bots/${Util.resolveID(id)}/votes`, + 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 */ - userVoted(id: IDResolvable, userID: IDResolvable) { - return this._request({ - url: `/bots/${Util.resolveID(id)}/check`, - params: { userId: Util.resolveID(userID) } - }) + userVoted(botId: IDResolvable, userID: IDResolvable) { + return this._request( + { + url: `/bots/${Util.resolveID(botId)}/check`, + params: { userId: Util.resolveID(userID) }, + headers: { Authorization: this.token } + }, + { requiresToken: true } + ) } /**