Skip to content

Commit 74dc893

Browse files
authored
Create BotlistMe.ts (#740)
* Create BotlistMe.ts Adding new bot list. Here's the docs https://docs.botlist.me/ * Update ListIndex.ts * Update services.md * Update BotlistMe.ts
1 parent e03b3ae commit 74dc893

File tree

3 files changed

+81
-1
lines changed

3 files changed

+81
-1
lines changed

docs/general/services.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,19 @@ Class: [Blist](/#/docs/main/$$$ref/class/Blist)
2828
Website: https://blist.xyz
2929
</div>
3030

31+
<div align=center>
32+
<p>
33+
<img src="https://botlist.me/icon.png" alt="botlistme logo" width="100" align="left" />
34+
</p>
35+
<i id="botlistme"></i>
36+
<i id="botlist.me"></i>
37+
<a href="https://botlist.me"><h1>BotlistMe</h1></a>
38+
39+
Keys: `botlistme`, `botlist.me`
40+
Class: [BotlistMe](/#/docs/main/$$$ref/class/BotlistMe)
41+
Website: https://botlist.me
42+
</div>
43+
3144
<div align=center>
3245
<p>
3346
<img src="https://bots.ondiscord.xyz/favicon/android-chrome-256x256.png" alt="botsondiscord logo" width="100" align="left" />
@@ -374,4 +387,4 @@ Website: https://wonderbotlist.com/en
374387
Keys: `yabl`, `yabl.xyz`
375388
Class: [YABL](/#/docs/main/$$$ref/class/YABL)
376389
Website: https://yabl.xyz/
377-
</div>
390+
</div>

src/Interface/ListIndex.ts

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import BladeList from './Lists/BladeList'
66
import Blist from './Lists/Blist'
7+
import BotlistMe from './Lists/BotlistMe'
78
import BotsOnDiscord from './Lists/BotsOnDiscord'
89
import Carbon from './Lists/Carbon'
910
import DBots from './Lists/DBots'
@@ -39,6 +40,8 @@ export const serviceList = {
3940
'bladelist.gg': BladeList,
4041
'blist': Blist,
4142
'blist.xyz': Blist,
43+
'botlistme': BotlistMe,
44+
'botlist.me': BotlistMe,
4245
'botsondiscord': BotsOnDiscord,
4346
'bots.ondiscord.xyz': BotsOnDiscord,
4447
'carbonitex': Carbon,

src/Interface/Lists/BotlistMe.ts

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import { Service, ServicePostOptions } from '../Service'
2+
import { Util, IDResolvable } from '../../Utils/Util'
3+
4+
/**
5+
* Represents the BotlistMe service.
6+
* @see https://docs.botlist.me
7+
*/
8+
export default class BotlistMe extends Service {
9+
/** The values that can be used to select the service. */
10+
static get aliases() {
11+
return ['botlistme', 'botlist.me']
12+
}
13+
14+
/** The logo URL. */
15+
static get logoURL() {
16+
return 'https://botlist.me/icon.png'
17+
}
18+
19+
/** Service's name. */
20+
static get serviceName() {
21+
return 'BotlistMe'
22+
}
23+
24+
/** The website URL. */
25+
static get websiteURL() {
26+
return 'https://botlist.me/'
27+
}
28+
29+
/** The base URL of the service's API. */
30+
static get baseURL() {
31+
return 'https://api.botlist.me/api/v1'
32+
}
33+
34+
/**
35+
* Posts statistics to this service.
36+
* <warn>Shard data posting is not supported for this service.</warn>
37+
* @param options The options of the request.
38+
*/
39+
static post(options: ServicePostOptions) {
40+
const { token, clientID, serverCount } = options
41+
return super._post({
42+
method: 'post',
43+
url: `/bots/${Util.resolveID(clientID)}/stats/`,
44+
headers: { Authorization: token },
45+
data: { server_count: Util.resolveCount(serverCount) }
46+
})
47+
}
48+
49+
/**
50+
* Gets whether a user has voted for a bot.
51+
* @param botID The bot's ID.
52+
* @param userID The user's ID.
53+
*/
54+
userVoted(botID: IDResolvable, userID: IDResolvable) {
55+
return this._request(
56+
{
57+
url: `/bots/${Util.resolveID(botID)}/voted`,
58+
headers: { Authorization: this.token },
59+
params: { user_id: Util.resolveID(userID) }
60+
},
61+
{ requiresToken: true }
62+
)
63+
}
64+
}

0 commit comments

Comments
 (0)