@@ -1331,6 +1331,51 @@ def get_user(self, user_id: str) -> HTTPResponse:
1331
1331
requires_token = True
1332
1332
)
1333
1333
1334
+ class DiscordLabs (Service ):
1335
+ """
1336
+ Represents the Discord Labs service.
1337
+
1338
+ .. seealso::
1339
+ - `Discord Labs Website <https://bots.discordlabs.org/>`_
1340
+ - `Discord Labs API Documentation <https://docs.discordlabs.org/docs/api/api>`_
1341
+ """
1342
+
1343
+ BASE_URL = 'https://bots.discordlabs.org/v2'
1344
+
1345
+ @staticmethod
1346
+ def aliases () -> list :
1347
+ return ['discordlabs' , 'discord-labs' , 'discordlabs.org' , 'bots.discordlabs.org' ]
1348
+
1349
+ @staticmethod
1350
+ def _post (
1351
+ http_client : HTTPClient , bot_id : str , token : str ,
1352
+ server_count = 0 , user_count = 0 ,
1353
+ voice_connections = 0 , shard_count : int = None ,
1354
+ shard_id : int = None
1355
+ ) -> HTTPResponse :
1356
+ payload = { 'server_count' : server_count , 'token' : token }
1357
+ if shard_id and shard_count :
1358
+ payload ['shard_count' ] = shard_count
1359
+ return http_client .request (
1360
+ method = 'POST' ,
1361
+ path = f'{ DiscordLabs .BASE_URL } /bot/{ bot_id } /stats' ,
1362
+ json = payload
1363
+ )
1364
+
1365
+ def get_bot (self , bot_id : str ) -> HTTPResponse :
1366
+ """|httpres|\n
1367
+ Gets the bot listed on this service.
1368
+
1369
+ Parameters
1370
+ -----------
1371
+ bot_id: :class:`str`
1372
+ The bot's ID.
1373
+ """
1374
+ return self ._request (
1375
+ method = 'GET' ,
1376
+ path = f'/bot/{ bot_id } ' ,
1377
+ )
1378
+
1334
1379
class GlennBotList (Service ):
1335
1380
"""
1336
1381
Represents the Glenn Bot List service.
@@ -2087,6 +2132,6 @@ def get_unverified_bots(self) -> HTTPResponse:
2087
2132
Service .SERVICES = [
2088
2133
Arcane , Blist , BotListSpace , BotsDataBase , BotsForDiscord , BotsOnDiscord , Carbon ,
2089
2134
DBLista , DiscordBotsCo , DiscordBotsGG , DiscordAppsDev , DiscordBoats ,
2090
- DiscordBotList , DiscordBotWorld , DiscordExtremeList , GlennBotList ,
2135
+ DiscordBotList , DiscordBotWorld , DiscordExtremeList , DiscordLabs , GlennBotList ,
2091
2136
LBots , ListMyBots , MythicalBots , SpaceBotsList , TopGG , WonderBotList , YABL
2092
2137
]
0 commit comments