From 8beb0bc3096b18d2c98838e633a8b68f36053ace Mon Sep 17 00:00:00 2001 From: Scorprian <43557305+ScorprianDev@users.noreply.github.com> Date: Thu, 26 Jan 2023 17:39:45 +1300 Subject: [PATCH 1/4] Update and rename RadarBotList.ts to Radarcord.ts --- .../Lists/{RadarBotList.ts => Radarcord.ts} | 77 ++++++++++++++++--- 1 file changed, 68 insertions(+), 9 deletions(-) rename src/Interface/Lists/{RadarBotList.ts => Radarcord.ts} (50%) diff --git a/src/Interface/Lists/RadarBotList.ts b/src/Interface/Lists/Radarcord.ts similarity index 50% rename from src/Interface/Lists/RadarBotList.ts rename to src/Interface/Lists/Radarcord.ts index 3d817525..0d8b0518 100644 --- a/src/Interface/Lists/RadarBotList.ts +++ b/src/Interface/Lists/Radarcord.ts @@ -5,30 +5,30 @@ import { Util, IDResolvable } from '../../Utils/Util' * Represents the Radar Bot Directory service. * @see https://docs.radarbotdirectory.xyz/ */ -export default class RadarBotDirectory extends Service { +export default class Radarcord extends Service { /** The values that can be used to select the service. */ static get aliases() { - return ['radar', 'radarbots', 'radarbotdirectory.xyz'] + return ['radar', 'radarcord', 'radarcord.net'] } /** The logo URL. */ static get logoURL() { - return 'https://theoverlook.xyz/Images/RBD/botlistlogo.png' + return 'https://radarcord.net/static/logo.png' } /** Service's name. */ static get serviceName() { - return 'Radar Bot Directory' + return 'Radarcord' } /** The website URL. */ static get websiteURL() { - return 'https://radarbotdirectory.xyz' + return 'https://radarcord.net' } /** The base URL of the service's API. */ static get baseURL() { - return 'https://radarbotdirectory.xyz/api' + return 'https://radarcord.net/api' } /** @@ -66,11 +66,70 @@ export default class RadarBotDirectory extends Service { getBotVotes(botID: IDResolvable, userID: IDResolvable) { return this._request( { - url: `/lastvoted/${Util.resolveID(userID)}/${Util.resolveID(botID)}`, - headers: { Authorization: this.token } + url: `/lastvoted/${Util.resolveID(userID)}/${Util.resolveID(botID)}` }, { - requiresToken: true + requiresToken: false + } + ) + } + + /** + * Gets the username, ID and listed bots of user + * @param userID The user's ID + */ + getUser(userID: IDResolvable) { + return this._request( + { + url: `/user/${Util.resolveID(userID)}` + }, + { + requiresToken: false + } + ) + } + + /** + * Returns a 1 or 0 depending on whether the user has voted for the bot + * @param botID The bot's ID + * @param userID The user's ID + */ + getBotVotes(botID: IDResolvable, userID: IDResolvable) { + return this._request( + { + url: `/hasvoted/${Util.resolveID(userID)}/${Util.resolveID(botID)}` + }, + { + requiresToken: false + } + ) + } +/** + * Returns a 1 or 0 depending on whether the user has voted for the bot + * @param botID The bot's ID + * @param userID The user's ID + */ + getBotVotes(botID: IDResolvable, userID: IDResolvable) { + return this._request( + { + url: `/hasvoted/${Util.resolveID(userID)}/${Util.resolveID(botID)}` + }, + { + requiresToken: false + } + ) + } +/** + * Get listed reviews of bot + * @param botID The bot's ID + */ + getBotVotes(botID: IDResolvable, userID: IDResolvable) { + return this._request( + { + url: `/bot/${Util.resolveID(userID)}/reviews` + }, + { + requiresToken: false } ) } From 4511935c65c257535a99550630fd4bb46f37d5dd Mon Sep 17 00:00:00 2001 From: Scorprian <43557305+ScorprianDev@users.noreply.github.com> Date: Fri, 27 Jan 2023 09:45:17 +1300 Subject: [PATCH 2/4] Update src/Interface/Lists/Radarcord.ts Co-authored-by: Federico Grandi --- src/Interface/Lists/Radarcord.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Interface/Lists/Radarcord.ts b/src/Interface/Lists/Radarcord.ts index 0d8b0518..3558f27c 100644 --- a/src/Interface/Lists/Radarcord.ts +++ b/src/Interface/Lists/Radarcord.ts @@ -90,7 +90,7 @@ export default class Radarcord extends Service { } /** - * Returns a 1 or 0 depending on whether the user has voted for the bot + * Gets whether the user has voted for the bot * @param botID The bot's ID * @param userID The user's ID */ From 353de4d042b0492d2c884130d5278bf05355a6a2 Mon Sep 17 00:00:00 2001 From: Scorprian <43557305+ScorprianDev@users.noreply.github.com> Date: Fri, 27 Jan 2023 09:45:28 +1300 Subject: [PATCH 3/4] Update src/Interface/Lists/Radarcord.ts Co-authored-by: Federico Grandi --- src/Interface/Lists/Radarcord.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Interface/Lists/Radarcord.ts b/src/Interface/Lists/Radarcord.ts index 3558f27c..a3a6cdac 100644 --- a/src/Interface/Lists/Radarcord.ts +++ b/src/Interface/Lists/Radarcord.ts @@ -2,8 +2,8 @@ import { Service, ServicePostOptions } from '../Service' import { Util, IDResolvable } from '../../Utils/Util' /** - * Represents the Radar Bot Directory service. - * @see https://docs.radarbotdirectory.xyz/ + * Represents the Radarcord service. + * @see https://docs.radarcord.net/ */ export default class Radarcord extends Service { /** The values that can be used to select the service. */ From 4b3868ad8ed5d158e08cc277af6d520ad94aa554 Mon Sep 17 00:00:00 2001 From: Scorprian <43557305+ScorprianDev@users.noreply.github.com> Date: Fri, 27 Jan 2023 09:45:36 +1300 Subject: [PATCH 4/4] Update src/Interface/Lists/Radarcord.ts Co-authored-by: Federico Grandi --- src/Interface/Lists/Radarcord.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Interface/Lists/Radarcord.ts b/src/Interface/Lists/Radarcord.ts index a3a6cdac..1d01939a 100644 --- a/src/Interface/Lists/Radarcord.ts +++ b/src/Interface/Lists/Radarcord.ts @@ -8,7 +8,7 @@ import { Util, IDResolvable } from '../../Utils/Util' export default class Radarcord extends Service { /** The values that can be used to select the service. */ static get aliases() { - return ['radar', 'radarcord', 'radarcord.net'] + return ['radar', 'radarbots', 'radarbotdirectory.xyz', 'radarcord', 'radarcord.net'] } /** The logo URL. */