From 1751a97c69f852e7df4b42d65e7b7a58d1ea928e Mon Sep 17 00:00:00 2001 From: Scorprian <43557305+ScorprianDev@users.noreply.github.com> Date: Wed, 29 Jun 2022 19:38:37 +1200 Subject: [PATCH 1/5] Create RadarBotDirectory.xyz --- src/Interface/Lists/RadarBotDirectory.xyz | 80 +++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 src/Interface/Lists/RadarBotDirectory.xyz diff --git a/src/Interface/Lists/RadarBotDirectory.xyz b/src/Interface/Lists/RadarBotDirectory.xyz new file mode 100644 index 00000000..8e48e68a --- /dev/null +++ b/src/Interface/Lists/RadarBotDirectory.xyz @@ -0,0 +1,80 @@ +import { Service, ServicePostOptions } from '../Service' +import { Util, IDResolvable } from '../../Utils/Util' +import { Query } from '../../Utils/Constants' + +/** + * Represents the Radar Bot Directory service. + * @see https://docs.radarbotdirectory.xyz/ + */ +export default class radarbotdirectory extends Service { + /** The values that can be used to select the service. */ + static get aliases() { + return ['radar', 'radarbots', 'radarbotdirectory.xyz'] + } + + /** The logo URL. */ + static get logoURL() { + return 'https://theoverlook.xyz/Images/RBD/botlistlogo.png' + } + + /** Service's name. */ + static get serviceName() { + return 'Radar Bot Directory' + } + + /** The website URL. */ + static get websiteURL() { + return 'https://radarbotdirectory.xyz' + } + + /** The base URL of the service's API. */ + static get baseURL() { + return 'https://radarbotdirectory.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: 'patch', + url: `/bot/${Util.resolveID(clientID)}/stats/`, + headers: { Authorization: token }, + data: shard + ? { + guilds: Util.resolveCount(serverCount), + shards: 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: `/bot/${Util.resolveID(id)}` }) + } + + /** + * Gets the Unix Epoch Timestamp of the last time this user voted for this bot on this service. + * @param id The bot's ID + * @param userid The user's ID + */ + getBotVotes(id: IDResolvable) { + return this._request( + { + url: `/lastvoted/${Util.resolveID(userid)}/${Util.resolveID(id)}`, + headers: { Authorization: this.token } + }, + { + requiresToken: true + } + ) + } + From 32a3edb7817ae45f4072544778d453e607060022 Mon Sep 17 00:00:00 2001 From: Federico Grandi Date: Thu, 30 Jun 2022 13:33:38 +0200 Subject: [PATCH 2/5] Update src/Interface/Lists/RadarBotDirectory.xyz --- src/Interface/Lists/RadarBotDirectory.xyz | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Interface/Lists/RadarBotDirectory.xyz b/src/Interface/Lists/RadarBotDirectory.xyz index 8e48e68a..9d3f39e4 100644 --- a/src/Interface/Lists/RadarBotDirectory.xyz +++ b/src/Interface/Lists/RadarBotDirectory.xyz @@ -6,7 +6,7 @@ import { Query } from '../../Utils/Constants' * Represents the Radar Bot Directory service. * @see https://docs.radarbotdirectory.xyz/ */ -export default class radarbotdirectory extends Service { +export default class RadarBotDirectory extends Service { /** The values that can be used to select the service. */ static get aliases() { return ['radar', 'radarbots', 'radarbotdirectory.xyz'] From e033ad560476bcd143481726228c3c741a5a6473 Mon Sep 17 00:00:00 2001 From: Federico Grandi Date: Thu, 30 Jun 2022 13:33:45 +0200 Subject: [PATCH 3/5] Update src/Interface/Lists/RadarBotDirectory.xyz --- src/Interface/Lists/RadarBotDirectory.xyz | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Interface/Lists/RadarBotDirectory.xyz b/src/Interface/Lists/RadarBotDirectory.xyz index 9d3f39e4..fdbf7f5f 100644 --- a/src/Interface/Lists/RadarBotDirectory.xyz +++ b/src/Interface/Lists/RadarBotDirectory.xyz @@ -29,7 +29,7 @@ export default class RadarBotDirectory extends Service { /** The base URL of the service's API. */ static get baseURL() { - return 'https://radarbotdirectory.xyz/api/' + return 'https://radarbotdirectory.xyz/api' } /** From b5dd91076ee368c86735f8071aad9ab2faa050bb Mon Sep 17 00:00:00 2001 From: Federico Grandi Date: Thu, 30 Jun 2022 13:33:52 +0200 Subject: [PATCH 4/5] Update src/Interface/Lists/RadarBotDirectory.xyz --- src/Interface/Lists/RadarBotDirectory.xyz | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Interface/Lists/RadarBotDirectory.xyz b/src/Interface/Lists/RadarBotDirectory.xyz index fdbf7f5f..bd033356 100644 --- a/src/Interface/Lists/RadarBotDirectory.xyz +++ b/src/Interface/Lists/RadarBotDirectory.xyz @@ -47,7 +47,7 @@ export default class RadarBotDirectory extends Service { guilds: Util.resolveCount(serverCount), shards: shard.count } - : { server_count: Util.resolveCount(serverCount) } + : { guilds: Util.resolveCount(serverCount) } }) } From c4185cdc3e90fce3e0b834833c027a63c4dbc83a Mon Sep 17 00:00:00 2001 From: Federico Grandi Date: Thu, 30 Jun 2022 13:34:00 +0200 Subject: [PATCH 5/5] Update src/Interface/Lists/RadarBotDirectory.xyz --- src/Interface/Lists/RadarBotDirectory.xyz | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Interface/Lists/RadarBotDirectory.xyz b/src/Interface/Lists/RadarBotDirectory.xyz index bd033356..be0158d1 100644 --- a/src/Interface/Lists/RadarBotDirectory.xyz +++ b/src/Interface/Lists/RadarBotDirectory.xyz @@ -63,13 +63,13 @@ export default class RadarBotDirectory extends Service { /** * Gets the Unix Epoch Timestamp of the last time this user voted for this bot on this service. - * @param id The bot's ID - * @param userid The user's ID + * @param botID The bot's ID + * @param userID The user's ID */ - getBotVotes(id: IDResolvable) { + getBotVotes(botID: IDResolvable, userID: IDResolvable) { return this._request( { - url: `/lastvoted/${Util.resolveID(userid)}/${Util.resolveID(id)}`, + url: `/lastvoted/${Util.resolveID(userID)}/${Util.resolveID(botID)}`, headers: { Authorization: this.token } }, {