Skip to content

Commit 7466275

Browse files
authored
feat: add RadarBotList (#466)
* feat: add RadarBotList * [auto] docs: update docs
1 parent adb1219 commit 7466275

File tree

3 files changed

+102
-7
lines changed

3 files changed

+102
-7
lines changed

docs/general/services.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Supported Services (26)
1+
# Supported Services (27)
22

33
<div align=center>
44
<p>
@@ -269,6 +269,20 @@ Class: [MotionBotList](/#/docs/main/$$$ref/class/MotionBotList)
269269
Website: https://www.motiondevelopment.top/bot
270270
</div>
271271

272+
<div align=center>
273+
<p>
274+
<img src="https://theoverlook.xyz/Images/RBD/botlistlogo.png" alt="radar logo" width="100" align="left" />
275+
</p>
276+
<i id="radar"></i>
277+
<i id="radarbots"></i>
278+
<i id="radarbotdirectory.xyz"></i>
279+
<a href="https://radarbotdirectory.xyz"><h1>Radar Bot Directory</h1></a>
280+
281+
Keys: `radar`, `radarbots`, `radarbotdirectory.xyz`
282+
Class: [RadarBotList](/#/docs/main/$$$ref/class/RadarBotList)
283+
Website: https://radarbotdirectory.xyz
284+
</div>
285+
272286
<div align=center>
273287
<p>
274288
<img src="https://cdn.discordapp.com/avatars/546742409409593354/123b9b0a54b45d99627215c7154580af.webp?size=256" alt="spacebotslist logo" width="100" align="left" />

src/Interface/ListIndex.ts

+10-6
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,16 @@ import DiscordBotlistEU from './Lists/DiscordBotlistEU'
1313
import DiscordBotsGG from './Lists/DiscordBotsGG'
1414
import DiscordExtremeList from './Lists/DiscordExtremeList'
1515
import DiscordLabs from './Lists/DiscordLabs'
16-
import DiscordListology from './Lists/DiscordListology'
1716
import DiscordListSpace from './Lists/DiscordListSpace'
18-
import DiscordsCom from './Lists/DiscordsCom'
17+
import DiscordListology from './Lists/DiscordListology'
1918
import DiscordServices from './Lists/DiscordServices'
19+
import DiscordsCom from './Lists/DiscordsCom'
2020
import Disforge from './Lists/Disforge'
2121
import FatesList from './Lists/FatesList'
2222
import InfinityBotList from './Lists/InfinityBotList'
2323
import Listcord from './Lists/Listcord'
2424
import MotionBotList from './Lists/MotionBotList'
25+
import RadarBotList from './Lists/RadarBotList'
2526
import SpaceBotsList from './Lists/SpaceBotsList'
2627
import TopCord from './Lists/TopCord'
2728
import TopGG from './Lists/TopGG'
@@ -56,18 +57,18 @@ export const serviceList = {
5657
'discordextremelist.xyz': DiscordExtremeList,
5758
'discordlabs': DiscordLabs,
5859
'discordlabs.org': DiscordLabs,
59-
'discordlistology': DiscordListology,
60-
'discordlistology.com': DiscordListology,
6160
'discordlistspace': DiscordListSpace,
6261
'discordlist.space': DiscordListSpace,
6362
'botlistspace': DiscordListSpace,
6463
'botlist.space': DiscordListSpace,
64+
'discordlistology': DiscordListology,
65+
'discordlistology.com': DiscordListology,
66+
'discordservices': DiscordServices,
67+
'discordservices.net': DiscordServices,
6568
'botsfordiscord': DiscordsCom,
6669
'botsfordiscord.com': DiscordsCom,
6770
'discords': DiscordsCom,
6871
'discords.com': DiscordsCom,
69-
'discordservices': DiscordServices,
70-
'discordservices.net': DiscordServices,
7172
'disforge': Disforge,
7273
'disforge.com': Disforge,
7374
'fateslist': FatesList,
@@ -80,6 +81,9 @@ export const serviceList = {
8081
'motiondevelopment': MotionBotList,
8182
'motionbotlist': MotionBotList,
8283
'motiondevelopment.top': MotionBotList,
84+
'radar': RadarBotList,
85+
'radarbots': RadarBotList,
86+
'radarbotdirectory.xyz': RadarBotList,
8387
'spacebotslist': SpaceBotsList,
8488
'space-bot-list.xyz': SpaceBotsList,
8589
'topcord': TopCord,

src/Interface/Lists/RadarBotList.ts

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
import { Service, ServicePostOptions } from '../Service'
2+
import { Util, IDResolvable } from '../../Utils/Util'
3+
4+
/**
5+
* Represents the Radar Bot Directory service.
6+
* @see https://docs.radarbotdirectory.xyz/
7+
*/
8+
export default class RadarBotDirectory extends Service {
9+
/** The values that can be used to select the service. */
10+
static get aliases() {
11+
return ['radar', 'radarbots', 'radarbotdirectory.xyz']
12+
}
13+
14+
/** The logo URL. */
15+
static get logoURL() {
16+
return 'https://theoverlook.xyz/Images/RBD/botlistlogo.png'
17+
}
18+
19+
/** Service's name. */
20+
static get serviceName() {
21+
return 'Radar Bot Directory'
22+
}
23+
24+
/** The website URL. */
25+
static get websiteURL() {
26+
return 'https://radarbotdirectory.xyz'
27+
}
28+
29+
/** The base URL of the service's API. */
30+
static get baseURL() {
31+
return 'https://radarbotdirectory.xyz/api'
32+
}
33+
34+
/**
35+
* Posts statistics to this service.
36+
* @param options The options of the request
37+
*/
38+
static post(options: ServicePostOptions) {
39+
const { token, clientID, serverCount, shard } = options
40+
return super._post({
41+
method: 'patch',
42+
url: `/bot/${Util.resolveID(clientID)}/stats/`,
43+
headers: { Authorization: token },
44+
data: shard
45+
? {
46+
guilds: Util.resolveCount(serverCount),
47+
shards: shard.count
48+
}
49+
: { guilds: Util.resolveCount(serverCount) }
50+
})
51+
}
52+
53+
/**
54+
* Gets the bot listed on this service.
55+
* @param id The bot's ID
56+
*/
57+
getBot(id: IDResolvable) {
58+
return this._request({ url: `/bot/${Util.resolveID(id)}` })
59+
}
60+
61+
/**
62+
* Gets the Unix Epoch Timestamp of the last time this user voted for this bot on this service.
63+
* @param botID The bot's ID
64+
* @param userID The user's ID
65+
*/
66+
getBotVotes(botID: IDResolvable, userID: IDResolvable) {
67+
return this._request(
68+
{
69+
url: `/lastvoted/${Util.resolveID(userID)}/${Util.resolveID(botID)}`,
70+
headers: { Authorization: this.token }
71+
},
72+
{
73+
requiresToken: true
74+
}
75+
)
76+
}
77+
}

0 commit comments

Comments
 (0)