diff --git a/docs/general/services.md b/docs/general/services.md index 3821fefb..88c50aab 100644 --- a/docs/general/services.md +++ b/docs/general/services.md @@ -2,28 +2,17 @@

- astrobotlist logo -

- - -

Astro Bot List

- -Keys: `astrobotlist`, `botlists.com` -Class: [AstroBotList](/#/docs/main/$$$ref/class/AstroBotList) -Website: https://botlists.com -
- -
-

- bladebotlist logo + bladebotlist logo

-

BladeBotList

+ + +

BladeList

-Keys: `bladebotlist`, `bladebotlist.xyz` -Class: [BladeBotList](/#/docs/main/$$$ref/class/BladeBotList) -Website: https://bladebotlist.xyz +Keys: `bladebotlist`, `bladebotlist.xyz`, `bladelist`, `bladelist.gg` +Class: [BladeList](/#/docs/main/$$$ref/class/BladeList) +Website: https://bladelist.gg
@@ -39,20 +28,6 @@ Class: [Blist](/#/docs/main/$$$ref/class/Blist) Website: https://blist.xyz
-
-

- botsfordiscord logo -

- - - -

Bots For Discord

- -Keys: `botsfordiscord`, `botsfordiscord.com`, `discords` -Class: [BotsForDiscord](/#/docs/main/$$$ref/class/BotsForDiscord) -Website: https://discords.com/bots -
-

botsondiscord logo @@ -132,19 +107,6 @@ Class: [DiscordBotlistEU](/#/docs/main/$$$ref/class/DiscordBotlistEU) Website: https://discord-botlist.eu/

-
-

- discordbotsco logo -

- - -

DiscordBots.co

- -Keys: `discordbotsco`, `discordbots.co` -Class: [DiscordBotsCo](/#/docs/main/$$$ref/class/DiscordBotsCo) -Website: https://discordbots.co -
-

discordbotsgg logo @@ -201,7 +163,7 @@ Website: https://discordlist.space

- discordlistology logo + discordlistology logo

@@ -225,6 +187,21 @@ Class: [DiscordServices](/#/docs/main/$$$ref/class/DiscordServices) Website: https://discordservices.net
+
+

+ botsfordiscord logo +

+ + + + +

Discords.com

+ +Keys: `botsfordiscord`, `botsfordiscord.com`, `discords`, `discords.com` +Class: [DiscordsCom](/#/docs/main/$$$ref/class/DiscordsCom) +Website: https://discords.com/bots +
+

disforge logo @@ -277,6 +254,34 @@ Class: [InfinityBotList](/#/docs/main/$$$ref/class/InfinityBotList) Website: https://infinitybotlist.com/

+
+

+ listcord logo +

+ + +

Listcord

+ +Keys: `listcord`, `listcord.gg` +Class: [Listcord](/#/docs/main/$$$ref/class/Listcord) +Website: https://listcord.gg/ +
+ +
+

+ motion logo +

+ + + + +

Motion Botlist

+ +Keys: `motion`, `motiondevelopment`, `motionbotlist`, `motiondevelopment.top` +Class: [MotionBotList](/#/docs/main/$$$ref/class/MotionBotList) +Website: https://www.motiondevelopment.top/bot +
+

spacebotslist logo diff --git a/src/Interface/ListIndex.ts b/src/Interface/ListIndex.ts index ca83f52f..90091c17 100644 --- a/src/Interface/ListIndex.ts +++ b/src/Interface/ListIndex.ts @@ -2,27 +2,27 @@ // // This section is automatically generated by the 'build:source' script, any change will be overwritten -import AstroBotList from './Lists/AstroBotList' -import BladeBotList from './Lists/BladeBotList' +import BladeList from './Lists/BladeList' import Blist from './Lists/Blist' -import BotsForDiscord from './Lists/BotsForDiscord' import BotsOnDiscord from './Lists/BotsOnDiscord' import Carbon from './Lists/Carbon' import DBots from './Lists/DBots' import DiscordBoats from './Lists/DiscordBoats' import DiscordBotList from './Lists/DiscordBotList' import DiscordBotlistEU from './Lists/DiscordBotlistEU' -import DiscordBotsCo from './Lists/DiscordBotsCo' import DiscordBotsGG from './Lists/DiscordBotsGG' import DiscordExtremeList from './Lists/DiscordExtremeList' import DiscordLabs from './Lists/DiscordLabs' import DiscordListology from './Lists/DiscordListology' import DiscordListSpace from './Lists/DiscordListSpace' +import DiscordsCom from './Lists/DiscordsCom' import DiscordServices from './Lists/DiscordServices' import Disforge from './Lists/Disforge' import FatesList from './Lists/FatesList' import GlennBotList from './Lists/GlennBotList' import InfinityBotList from './Lists/InfinityBotList' +import Listcord from './Lists/Listcord' +import MotionBotList from './Lists/MotionBotList' import SpaceBotsList from './Lists/SpaceBotsList' import TopCord from './Lists/TopCord' import TopGG from './Lists/TopGG' @@ -32,15 +32,12 @@ import YABL from './Lists/YABL' // prettier-ignore export const serviceList = { - 'astrobotlist': AstroBotList, - 'botlists.com': AstroBotList, - 'bladebotlist': BladeBotList, - 'bladebotlist.xyz': BladeBotList, + 'bladebotlist': BladeList, + 'bladebotlist.xyz': BladeList, + 'bladelist': BladeList, + 'bladelist.gg': BladeList, 'blist': Blist, 'blist.xyz': Blist, - 'botsfordiscord': BotsForDiscord, - 'botsfordiscord.com': BotsForDiscord, - 'discords': BotsForDiscord, 'botsondiscord': BotsOnDiscord, 'bots.ondiscord.xyz': BotsOnDiscord, 'carbonitex': Carbon, @@ -54,8 +51,6 @@ export const serviceList = { 'discordbotlist.com': DiscordBotList, 'dbleu': DiscordBotlistEU, 'discordbotlisteu': DiscordBotlistEU, - 'discordbotsco': DiscordBotsCo, - 'discordbots.co': DiscordBotsCo, 'discordbotsgg': DiscordBotsGG, 'discord.bots.gg': DiscordBotsGG, 'discordextremelist': DiscordExtremeList, @@ -68,6 +63,10 @@ export const serviceList = { 'discordlist.space': DiscordListSpace, 'botlistspace': DiscordListSpace, 'botlist.space': DiscordListSpace, + 'botsfordiscord': DiscordsCom, + 'botsfordiscord.com': DiscordsCom, + 'discords': DiscordsCom, + 'discords.com': DiscordsCom, 'discordservices': DiscordServices, 'discordservices.net': DiscordServices, 'disforge': Disforge, @@ -78,6 +77,12 @@ export const serviceList = { 'glennbotlist.xyz': GlennBotList, 'infinitybotlist': InfinityBotList, 'infinitybotlist.com': InfinityBotList, + 'listcord': Listcord, + 'listcord.gg': Listcord, + 'motion': MotionBotList, + 'motiondevelopment': MotionBotList, + 'motionbotlist': MotionBotList, + 'motiondevelopment.top': MotionBotList, 'spacebotslist': SpaceBotsList, 'space-bot-list.xyz': SpaceBotsList, 'topcord': TopCord, diff --git a/src/Interface/Lists/AstroBotList.ts b/src/Interface/Lists/AstroBotList.ts deleted file mode 100644 index 5fbeddd5..00000000 --- a/src/Interface/Lists/AstroBotList.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { Service, ServicePostOptions } from '../Service' -import { Util } from '../../Utils/Util' - -/** - * Represents the Astro Bot List service. - * @see https://botlists.com/api/docs - */ -export default class AstroBotList extends Service { - /** The values that can be used to select the service. */ - static get aliases() { - return ['astrobotlist', 'botlists.com'] - } - - /** The logo URL. */ - static get logoURL() { - return 'https://cdn.bot-list.xyz/7364djcas.png' - } - - /** Service's name. */ - static get serviceName() { - return 'Astro Bot List' - } - - /** The website URL. */ - static get websiteURL() { - return 'https://botlists.com' - } - - /** The base URL of the service's API. */ - static get baseURL() { - return 'https://botlists.com/api' - } - - /** - * Posts statistics to this service. - * @param options The options of the request - */ - static post(options: ServicePostOptions) { - const { token, serverCount } = options - return super._post({ - method: 'post', - url: '/bot', - headers: { token }, - data: { - guild_count: Util.resolveCount(serverCount) - } - }) - } - - /** Gets the stats of this bot. */ - getOwnStats() { - return this._request( - { - url: '/bot', - headers: { token: this.token } - }, - { - requiresToken: true - } - ) - } -} diff --git a/src/Interface/Lists/BladeBotList.ts b/src/Interface/Lists/BladeBotList.ts deleted file mode 100644 index 57dcdbf4..00000000 --- a/src/Interface/Lists/BladeBotList.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { Service, ServicePostOptions } from '../Service' -import { Util, IDResolvable } from '../../Utils/Util' - -/** - * Represents the BladeBotList service. - * @see https://docs.bladebotlist.xyz/api/introduction.html - */ -export default class BladeBotList extends Service { - /** The values that can be used to select the service. */ - static get aliases() { - return ['bladebotlist', 'bladebotlist.xyz'] - } - - /** The logo URL. */ - static get logoURL() { - return 'https://bladebotlist.xyz/img/logo.svg' - } - - /** Service's name. */ - static get serviceName() { - return 'BladeBotList' - } - - /** The website URL. */ - static get websiteURL() { - return 'https://bladebotlist.xyz' - } - - /** The base URL of the service's API. */ - static get baseURL() { - return 'https://bladebotlist.xyz/api/' - } - - /** - * Posts statistics to this service. - * @param options The options of the request - */ - static post(options: ServicePostOptions) { - const { token, clientID, serverCount, shard } = options - return super._post({ - method: 'post', - url: `/bots/${Util.resolveID(clientID)}/stats/`, - headers: { Authorization: token }, - data: shard - ? { - server_count: Util.resolveCount(serverCount), - shard_count: shard.count - } - : { server_count: Util.resolveCount(serverCount) } - }) - } - - /** - * Gets the bot listed on this service. - * @param id The bot's ID - */ - getBot(id: IDResolvable) { - return this._request({ url: `/bots/${Util.resolveID(id)}` }) - } - - /** - * Checks whether a user has given a vote to the bot - * @param botId The bot's ID - * @param userID The user's ID - */ - userVoted(botId: IDResolvable, userID: IDResolvable) { - return this._request({ - url: `/bots/${Util.resolveID(botId)}/votes/${Util.resolveID(userID)}` - }) - } -} diff --git a/src/Interface/Lists/DiscordBotsCo.ts b/src/Interface/Lists/BladeList.ts similarity index 50% rename from src/Interface/Lists/DiscordBotsCo.ts rename to src/Interface/Lists/BladeList.ts index 52a0cb4d..24fe8383 100644 --- a/src/Interface/Lists/DiscordBotsCo.ts +++ b/src/Interface/Lists/BladeList.ts @@ -2,70 +2,66 @@ import { Service, ServicePostOptions } from '../Service' import { Util, IDResolvable } from '../../Utils/Util' /** - * Represents the DiscordBots.co service. - * @see https://discordbots.co/api-information + * Represents the BladeList service. + * @see https://docs.bladelist.gg/en/latest/api/index.html */ -export default class DiscordBotsCo extends Service { +export default class BladeList extends Service { /** The values that can be used to select the service. */ static get aliases() { - return ['discordbotsco', 'discordbots.co'] + return ['bladebotlist', 'bladebotlist.xyz', 'bladelist', 'bladelist.gg'] } /** The logo URL. */ static get logoURL() { - return 'https://cdn.discordapp.com/avatars/688927563409522694/17cfd572fd3e2d3285534c12e0f58422.png' + return 'https://bladelist.gg/static/img/logo.png' } /** Service's name. */ static get serviceName() { - return 'DiscordBots.co' + return 'BladeList' } /** The website URL. */ static get websiteURL() { - return 'https://discordbots.co' + return 'https://bladelist.gg' } /** The base URL of the service's API. */ static get baseURL() { - return 'https://api.discordbots.co/v1/public' + return 'https://api.bladelist.gg' } /** * Posts statistics to this service. - * @param options The options of the request + * @param options The options of the request. */ static post(options: ServicePostOptions) { const { token, clientID, serverCount, shard } = options return super._post({ - method: 'post', - url: `/bot/${Util.resolveID(clientID)}/stats`, + method: 'put', + url: `/bots/${Util.resolveID(clientID)}/`, headers: { Authorization: token, 'Content-Type': 'application/json' }, - data: shard - ? { - serverCount: Util.resolveCount(serverCount), - shardCount: shard.count - } - : { serverCount: Util.resolveCount(serverCount) } + data: { + server_count: Util.resolveCount(serverCount), + ...(shard ? { shard_count: shard.count } : {}) + } }) } /** - * Gets the bot listed on this service. - * @param id The bot's ID + * Gets a bot listed on this service. + * @param id The bot's ID. */ getBot(id: IDResolvable) { return this._request( { - url: `/bot/${Util.resolveID(id)}`, + url: `/bots/${Util.resolveID(id)}`, headers: { Authorization: this.token } }, - { - requiresToken: true - } + { requiresToken: true } ) } } diff --git a/src/Interface/Lists/DiscordLabs.ts b/src/Interface/Lists/DiscordLabs.ts index 89d8c3e8..179d2228 100644 --- a/src/Interface/Lists/DiscordLabs.ts +++ b/src/Interface/Lists/DiscordLabs.ts @@ -60,4 +60,12 @@ export default class DiscordLabs extends Service { getBot(id: IDResolvable) { return this._request({ url: `/bot/${Util.resolveID(id)}` }) } + + /** + * Gets the votes for this bot. + * @param id The bot's id. + */ + getVotes(id: IDResolvable) { + return this._request({ url: `/bot/${Util.resolveID(id)}/votes` }) + } } diff --git a/src/Interface/Lists/DiscordListSpace.ts b/src/Interface/Lists/DiscordListSpace.ts index 1bc76520..2a46e9d7 100644 --- a/src/Interface/Lists/DiscordListSpace.ts +++ b/src/Interface/Lists/DiscordListSpace.ts @@ -1,5 +1,5 @@ import { Service, ServicePostOptions } from '../Service' -import { Util, CountResolvable, IDResolvable } from '../../Utils/Util' +import { Util, IDResolvable } from '../../Utils/Util' import { Query } from '../../Utils/Constants' /** @@ -34,7 +34,7 @@ export default class DiscordListSpace extends Service { /** The base URL of the service's API. */ static get baseURL() { - return 'https://api.discordlist.space/v1' + return 'https://api.discordlist.space/v2' } /** @@ -47,7 +47,7 @@ export default class DiscordListSpace extends Service { return super._post({ method: 'post', url: `/bots/${Util.resolveID(clientID)}`, - headers: { Authorization: token }, + headers: { Authorization: token, 'Content-Type': 'application/json' }, data: { server_count: Util.resolveCount(serverCount) } }) } @@ -57,19 +57,69 @@ export default class DiscordListSpace extends Service { return this._request({ url: '/statistics' }) } - /** Gets a list of bots on this service. */ - getBots() { - return this._request({ url: '/bots' }) + /** + * Gets all the available languages that bots or servers can set as their language. + * @param query The query to use in the request. + */ + getLanguages(query?: Query) { + return this._request({ url: '/languages', params: query }) } - /** Gets the bot listed on this service. */ + /** + * Gets all available tags for use on bots or servers. + * @param query The query to use in the request. + */ + getTags(query?: Query) { + return this._request({ url: '/tags', params: query }) + } + + /** + * Gets a list of bots on this service. + * @param query The query to use in the request. + */ + getBots(query?: Query) { + return this._request({ url: '/bots', params: query }) + } + + /** + * Gets the bot listed on this service. + * @param id The bot's ID. + */ getBot(id: IDResolvable) { return this._request({ url: `/bots/${Util.resolveID(id)}` }) } + /** + * Gets the reviews of a bot. + * @param id The bot's ID. + * @param query The query to use in the request. + */ + getBotReviews(id: IDResolvable, query?: Query) { + return this._request({ + url: `/bots/${Util.resolveID(id)}/reviews`, + params: query + }) + } + + /** + * Gets the analytics on a bot. + * @param id The bot's ID. + * @param query The query to use in the request. + */ + getBotAnalytics(id: IDResolvable, query?: Query) { + return this._request( + { + url: `/bots/${Util.resolveID(id)}/analytics`, + headers: { Authorization: this.token }, + params: query + }, + { requiresToken: true } + ) + } + /** * Gets the list of people who voted this bot on this service. - * @param id The bot's ID + * @param id The bot's ID. */ getBotVotes(id: IDResolvable) { return this._request( @@ -84,16 +134,65 @@ export default class DiscordListSpace extends Service { } /** - * Gets the uptime of a bot listed on this service. - * @param id The bot's ID + * Checks if a specific user has upvoted the bot. + * @param botID The bot's ID. + * @param userID The user's ID. */ - getBotUptime(id: IDResolvable) { - return this._request({ url: `/bots/${Util.resolveID(id)}/uptime` }) + getUserUpvote(botID: IDResolvable, userID: IDResolvable) { + return this._request( + { + url: `/bots/${Util.resolveID(botID)}/upvotes/status/${Util.resolveID( + userID + )}`, + headers: { Authorization: this.token } + }, + { requiresToken: true } + ) + } + + /** + * Gets the top upvoters of this month. + * @param id The bot's ID. + * @param query The query to use with the request. + */ + getUpvoteLeaderboard(id: IDResolvable, query?: Query) { + return this._request({ + url: `/bots/${Util.resolveID(id)}/upvotes/leaderboard`, + params: query + }) + } + + /** + * Gets the bot listing audit log. + * @param id The bot's ID. + * @param query The query to use with the request. + */ + getAuditLog(id: IDResolvable, query?: Query) { + return this._request( + { + url: `/bots/${Util.resolveID(id)}/audit`, + headers: { Authorization: this.token }, + params: query + }, + { requiresToken: true } + ) + } + + /** + * Gets the owners of the bot listing. + * @param id The bot's ID. + * @param query The query to use in the request. + */ + getBotOwners(id: IDResolvable, query?: Query) { + return this._request({ + url: `/bots/${Util.resolveID(id)}/owners`, + params: query + }) } /** * Gets the user listed on this service. - * @param id The user's ID + * @param id The user's ID. */ getUser(id: IDResolvable) { return this._request({ url: `/users/${Util.resolveID(id)}` }) @@ -101,29 +200,24 @@ export default class DiscordListSpace extends Service { /** * Gets the user's bots listed for this service. - * @param id The user's ID + * @param id The user's ID. */ getUserBots(id: IDResolvable) { - return this._request({ url: `/users/${Util.resolveID(id)}/bots` }) + return this._request({ + url: `/users/${Util.resolveID(id)}/bots`, + headers: { Authorization: this.token } + }) } /** - * Gets the widget URL for this bot. - * @param id The bot's ID - * @param style The style of the widget, cannot be zero - * @param query The query string that will be used in the request + * Get all the lists that a user owns. + * @param id The user's ID. + * @param query The query to use in the request. */ - getWidgetURL( - id: IDResolvable, - style: CountResolvable = 1, - query: Query = {} - ) { - return this._appendQuery( - `https://api.botlist.space/widget/${Util.resolveID( - id - )}/${Util.resolveCount(style)}`, - query, - false - ) + getUserReviews(id: IDResolvable, query?: Query) { + return this._request({ + url: `/users/${Util.resolveID(id)}/reviews`, + params: query + }) } } diff --git a/src/Interface/Lists/DiscordListology.ts b/src/Interface/Lists/DiscordListology.ts index f68148fa..167d24ff 100644 --- a/src/Interface/Lists/DiscordListology.ts +++ b/src/Interface/Lists/DiscordListology.ts @@ -13,7 +13,7 @@ export default class DiscordListology extends Service { /** The logo URL. */ static get logoURL() { - return 'https://discordlistology.com/idiscord.png' + return 'https://i.imgur.com/DmSCuSk.png' } /** Service's name. */ diff --git a/src/Interface/Lists/BotsForDiscord.ts b/src/Interface/Lists/DiscordsCom.ts similarity index 62% rename from src/Interface/Lists/BotsForDiscord.ts rename to src/Interface/Lists/DiscordsCom.ts index d66baf13..d5dcef04 100644 --- a/src/Interface/Lists/BotsForDiscord.ts +++ b/src/Interface/Lists/DiscordsCom.ts @@ -3,13 +3,13 @@ import { Util, IDResolvable } from '../../Utils/Util' import { Query } from '../../Utils/Constants' /** - * Represents the Bots For Discord service. + * Represents the Discords.com service (formerly Bots For Discord). * @see https://docs.botsfordiscord.com/ */ -export default class BotsForDiscord extends Service { +export default class DiscordsCom extends Service { /** The values that can be used to select the service. */ static get aliases() { - return ['botsfordiscord', 'botsfordiscord.com', 'discords'] + return ['botsfordiscord', 'botsfordiscord.com', 'discords', 'discords.com'] } /** The logo URL. */ @@ -19,7 +19,7 @@ export default class BotsForDiscord extends Service { /** Service's name. */ static get serviceName() { - return 'Bots For Discord' + return 'Discords.com' } /** The website URL. */ @@ -35,7 +35,7 @@ export default class BotsForDiscord extends Service { /** * Posts statistics to this service. * Shard data posting is not supported for this service. - * @param options The options of the request + * @param options The options of the request. */ static post(options: ServicePostOptions) { const { token, clientID, serverCount } = options @@ -49,23 +49,48 @@ export default class BotsForDiscord extends Service { /** * Gets the bot listed on this service. - * @param id The bot's ID + * @param id The bot's ID. */ getBot(id: IDResolvable) { return this._request({ url: `/bot/${Util.resolveID(id)}` }) } /** - * Gets the list of people who voted this bot on this service. - * @param id The bot's ID + * Gets the list of people who voted a bot. + * @param id The bot's ID. */ getBotVotes(id: IDResolvable) { - return this._request({ url: `/bot/${Util.resolveID(id)}/votes` }) + return this._request( + { + url: `/bot/${Util.resolveID(id)}/votes`, + headers: { + Authorization: this.token, + 'Content-Type': 'application/json' + } + }, + { requiresToken: true } + ) + } + + /** + * Gets the list of people who voted a bot in the last 12 hours. + * @param id The bot's ID. + */ + getBotVotes12h(id: IDResolvable) { + return this._request( + { + url: `/bot/${Util.resolveID(id)}/votes12h`, + headers: { + Authorization: this.token + } + }, + { requiresToken: true } + ) } /** * Gets the user listed on this service. - * @param id The user's ID + * @param id The user's ID. */ getUser(id: IDResolvable) { return this._request({ url: `/user/${Util.resolveID(id)}` }) @@ -73,7 +98,7 @@ export default class BotsForDiscord extends Service { /** * Gets the user's bots listed for this service. - * @param id The user's ID + * @param id The user's ID. */ getUserBots(id: IDResolvable) { return this._request({ url: `/user/${Util.resolveID(id)}/bots` }) @@ -81,8 +106,8 @@ export default class BotsForDiscord extends Service { /** * Gets the widget URL for this bot. - * @param id The bot's ID - * @param query The query string that will be used in the request + * @param id The bot's ID. + * @param query The query that will be used in the request. */ getWidgetURL(id: IDResolvable, query?: Query) { return this._appendQuery(`/bot/${Util.resolveID(id)}/widget`, query || {}) diff --git a/src/Interface/Lists/InfinityBotList.ts b/src/Interface/Lists/InfinityBotList.ts index df350967..31a5371c 100644 --- a/src/Interface/Lists/InfinityBotList.ts +++ b/src/Interface/Lists/InfinityBotList.ts @@ -33,17 +33,18 @@ export default class InfinityBotList extends Service { /** * Posts statistics to this service. - * @param options The options of the request + * @param options The options of the request. */ static post(options: ServicePostOptions) { const { clientID, token, serverCount, shard } = options return super._post({ method: 'post', - url: `/bot/${Util.resolveID(clientID)}`, + url: `/bot/${Util.resolveID(clientID)}/stats`, headers: { authorization: token }, data: { + botid: clientID, servers: Util.resolveCount(serverCount), ...(shard?.count ? { @@ -56,17 +57,17 @@ export default class InfinityBotList extends Service { /** * Gets the bot listed on this service. - * @param id The bot's ID + * @param id The bot's ID. */ getBot(id: IDResolvable) { return this._request({ - url: `/bot/${Util.resolveID(id)}/info` + url: `/bot/${Util.resolveID(id)}` }) } /** * Gets the user listed on this service. - * @param id The user's ID + * @param id The user's ID. */ getUser(id: IDResolvable) { return this._request({ diff --git a/src/Interface/Lists/Listcord.ts b/src/Interface/Lists/Listcord.ts new file mode 100644 index 00000000..3bf86358 --- /dev/null +++ b/src/Interface/Lists/Listcord.ts @@ -0,0 +1,117 @@ +import { Service, ServicePostOptions } from '../Service' +import { Util, IDResolvable } from '../../Utils/Util' + +/** + * Represents the Listcord service. + * @see https://listcord.gg/docs + */ +export default class Listcord extends Service { + /** The values that can be used to select the service. */ + static get aliases() { + return ['listcord', 'listcord.gg'] + } + + /** The logo URL. */ + static get logoURL() { + return 'https://cdn.discordapp.com/avatars/803339251940196383/50e92bb535cf88641ec22756937e6950.webp' + } + + /** Service's name. */ + static get serviceName() { + return 'Listcord' + } + + /** The website URL. */ + static get websiteURL() { + return 'https://listcord.gg/' + } + + /** The base URL of the service's API. */ + static get baseURL() { + return 'https://listcord.gg/api/' + } + + /** + * Posts statistics to this service. + * Shard data posting is not supported for this service. + * @param options The options of the request. + */ + static post(options: ServicePostOptions) { + const { token, clientID, serverCount } = options + return super._post({ + method: 'post', + url: `/bots/${Util.resolveID(clientID)}/stats/`, + headers: { Authorization: token }, + data: { server_count: Util.resolveCount(serverCount) } + }) + } + + /** + * Gets a bot. + * @param id The bot's ID. + */ + getBot(id: IDResolvable) { + return this._request( + { + url: `/bots/${Util.resolveID(id)}`, + headers: { Authorization: this.token } + }, + { requiresToken: true } + ) + } + + /** + * Gets a bot's reviews. + * @param id The bot's ID. + */ + getBotReviews(id: IDResolvable) { + return this._request( + { + url: `/bot/${Util.resolveID(id)}/reviews`, + headers: { Authorization: this.token } + }, + { requiresToken: true } + ) + } + + /** + * Gets whether a user has voted for a bot. + * @param botID The bot's ID. + * @param userID The user's ID. + */ + userVoted(botID: IDResolvable, userID: IDResolvable) { + return this._request( + { + url: `/bot/${Util.resolveID(botID)}/voted`, + headers: { Authorization: this.token }, + params: { user_id: Util.resolveID(userID) } + }, + { requiresToken: true } + ) + } + + /** + * Gets a bot pack. + * @param id The pack's id. + */ + getBotPack(id: string) { + return this._request( + { + url: `/pack/${id}`, + headers: { Authorization: this.token } + }, + { requiresToken: true } + ) + } + + /** Gets all botpacks. */ + getBotPacks() { + return this._request( + { + url: '/packs', + headers: { Authorization: this.token } + }, + { requiresToken: true } + ) + } +} diff --git a/src/Interface/Lists/MotionBotList.ts b/src/Interface/Lists/MotionBotList.ts new file mode 100644 index 00000000..5e601158 --- /dev/null +++ b/src/Interface/Lists/MotionBotList.ts @@ -0,0 +1,90 @@ +import { Service, ServicePostOptions } from '../Service' +import { Util, IDResolvable } from '../../Utils/Util' + +/** + * Represents the MotionBotlist service. + * @see https://www.motiondevelopment.top/docs/api/intro + */ +export default class MotionBotlist extends Service { + /** The values that can be used to select the service. */ + static get aliases() { + return [ + 'motion', + 'motiondevelopment', + 'motionbotlist', + 'motiondevelopment.top' + ] + } + + /** The logo URL. */ + static get logoURL() { + return 'https://www.motiondevelopment.top/favicon.ico' + } + + /** Service's name. */ + static get serviceName() { + return 'Motion Botlist' + } + + /** The website URL. */ + static get websiteURL() { + return 'https://www.motiondevelopment.top/bot' + } + + /** The base URL of the service's API. */ + static get baseURL() { + return 'https://www.motiondevelopment.top/api/v1.2' + } + + /** + * Posts statistics to this service. + * Shard data posting is not supported for this service. + * @param options The options of the request. + */ + static post(options: ServicePostOptions) { + const { token, clientID, serverCount } = options + return super._post({ + method: 'put', + url: `/bots/${Util.resolveID(clientID)}/stats`, + headers: { + key: token, + 'Content-Type': 'application/json' + }, + data: { guilds: Util.resolveCount(serverCount) } + }) + } + + /** + * Gets a bot. + * @param id The bot's ID. + */ + getBot(id: IDResolvable) { + return this._request( + { + url: `/bots/${Util.resolveID(id)}`, + headers: { + key: this.token, + 'Content-Type': 'application/json' + } + }, + { requiresToken: true } + ) + } + + /** + * Gets a bot's votes. + * @param id The bot's ID. + */ + getBotVotes(id: IDResolvable) { + return this._request( + { + url: `/bots/${Util.resolveID(id)}/votes`, + headers: { + key: this.token, + 'Content-Type': 'application/json' + } + }, + { requiresToken: true } + ) + } +} diff --git a/src/Interface/Lists/TopGG.ts b/src/Interface/Lists/TopGG.ts index 78948e58..19757f5a 100644 --- a/src/Interface/Lists/TopGG.ts +++ b/src/Interface/Lists/TopGG.ts @@ -34,7 +34,7 @@ export default class TopGG extends Service { /** * Posts statistics to this service. - * @param options The options of the request + * @param options The options of the request. */ static post(options: ServicePostOptions) { const { token, clientID, serverCount, shard } = options @@ -54,7 +54,7 @@ export default class TopGG extends Service { /** * Gets the user listed on this service. - * @param id The user's ID + * @param id The user's ID. */ getUser(id: IDResolvable) { return this._request( @@ -68,7 +68,7 @@ export default class TopGG extends 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 + * @param query The query string that will be used in the request. */ getBots(query: Query) { return this._request( @@ -79,7 +79,7 @@ export default class TopGG extends Service { /** * Gets the bot listed on this service. - * @param id The bot's ID + * @param id The bot's ID. */ getBot(id: IDResolvable) { return this._request( @@ -93,7 +93,7 @@ export default class TopGG extends Service { /** * Gets the bot's stats listed on this service. - * @param id The bot's ID + * @param id The bot's ID. */ getBotStats(id: IDResolvable) { return this._request( @@ -107,7 +107,7 @@ 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 id The bot's ID. */ getBotVotes(id: IDResolvable) { return this._request( @@ -121,13 +121,13 @@ export default class TopGG extends Service { /** * Checks whether or not a user has voted for a bot on this service. - * @param botId The bot's ID - * @param userID The user's ID + * @param botID The bot's ID. + * @param userID The user's ID. */ - userVoted(botId: IDResolvable, userID: IDResolvable) { + userVoted(botID: IDResolvable, userID: IDResolvable) { return this._request( { - url: `/bots/${Util.resolveID(botId)}/check`, + url: `/bots/${Util.resolveID(botID)}/check`, params: { userId: Util.resolveID(userID) }, headers: { Authorization: this.token } }, @@ -137,9 +137,9 @@ export default class TopGG extends Service { /** * Gets the widget URL for this bot. - * @param id The bot's ID - * @param query The query string that will be used in the request - * @param smallWidget The sub-path name to turn the widget into a badge (i.e. owner) + * @param id The bot's ID. + * @param query The query string that will be used in the request. + * @param smallWidget The sub-path name to turn the widget into a badge (i.e. owner). */ getWidgetURL(id: IDResolvable, query?: Query, smallWidget?: string) { const subPath = smallWidget ? `${smallWidget}/` : '' diff --git a/src/Interface/Lists/VoidBots.ts b/src/Interface/Lists/VoidBots.ts index 074cc7e2..9c43ba28 100644 --- a/src/Interface/Lists/VoidBots.ts +++ b/src/Interface/Lists/VoidBots.ts @@ -33,7 +33,7 @@ export default class VoidBots extends Service { /** * Posts statistics to this service. - * @param options The options of the request + * @param options The options of the request. */ static post(options: ServicePostOptions) { const { token, clientID, serverCount, shard } = options @@ -52,7 +52,7 @@ export default class VoidBots extends Service { /** * Gets the bot listed on this service. - * @param id The bot's ID + * @param id The bot's ID. */ getBot(id: IDResolvable) { return this._request( @@ -68,13 +68,13 @@ export default class VoidBots extends Service { /** * Checks whether or not a user has voted for a bot on this service. - * @param botId The bot's ID - * @param userID The user's ID + * @param botID The bot's ID. + * @param userID The user's ID. */ - userVoted(botId: IDResolvable, userID: IDResolvable) { + userVoted(botID: IDResolvable, userID: IDResolvable) { return this._request( { - url: `/bot/voted/${Util.resolveID(botId)}/${Util.resolveID(userID)}`, + url: `/bot/voted/${Util.resolveID(botID)}/${Util.resolveID(userID)}`, headers: { Authorization: this.token } @@ -85,7 +85,7 @@ export default class VoidBots extends Service { /** * Gets the bot's reviews on this service. - * @param id The bot's ID + * @param id The bot's ID. */ getBotReviews(id: IDResolvable) { return this._request( @@ -99,7 +99,7 @@ export default class VoidBots extends Service { /** * Gets the bot's analytics on this service. - * @param id The bot's ID + * @param id The bot's ID. */ getBotAnalytics(id: IDResolvable) { return this._request(