@@ -1376,6 +1376,94 @@ def get_bot(self, bot_id: str) -> HTTPResponse:
1376
1376
path = f'/bot/{ bot_id } ' ,
1377
1377
)
1378
1378
1379
+ class DiscordListology (Service ):
1380
+ """
1381
+ Represents the DiscordListology service.
1382
+
1383
+ .. seealso::
1384
+ - `DiscordListology Website <https://discordlistology.com/>`_
1385
+ - `DiscordListology API Documentation <https://discordlistology.com/developer/documentation/>`_
1386
+ """
1387
+
1388
+ BASE_URL = 'https://discordlistology.com/api/v1'
1389
+
1390
+ @staticmethod
1391
+ def aliases () -> list :
1392
+ return ['discordlistology' ]
1393
+
1394
+ @staticmethod
1395
+ def _post (
1396
+ http_client : HTTPClient , bot_id : str , token : str ,
1397
+ server_count = 0 , user_count = 0 ,
1398
+ voice_connections = 0 , shard_count : int = None ,
1399
+ shard_id : int = None
1400
+ ) -> HTTPResponse :
1401
+ payload = { 'servers' : server_count }
1402
+ if shard_id and shard_count :
1403
+ payload ['shards' ] = shard_count
1404
+ return http_client .request (
1405
+ method = 'POST' ,
1406
+ path = f'{ DiscordListology .BASE_URL } /bots/{ bot_id } /stats' ,
1407
+ headers = { 'Authorization' : token },
1408
+ json = payload
1409
+ )
1410
+
1411
+ def get_bot_stats (self , bot_id : str ) -> HTTPResponse :
1412
+ """|httpres|\n
1413
+ Gets the bot's stats listed on this service.
1414
+ Parameters
1415
+ -----------
1416
+ bot_id: :class:`str`
1417
+ The bot's ID.
1418
+ """
1419
+ return self ._request (
1420
+ method = 'GET' ,
1421
+ path = f'/bots/{ bot_id } /stats' ,
1422
+ )
1423
+
1424
+ def user_voted_bot (self , bot_id : str , user_id : str ) -> HTTPResponse :
1425
+ """|httpres|\n
1426
+ Checks whether or not a user has voted for a bot on this service.
1427
+ Parameters
1428
+ -----------
1429
+ bot_id: :class:`str`
1430
+ The bot's ID.
1431
+ user_id: :class:`str`
1432
+ The user's ID.
1433
+ """
1434
+ return self ._request (
1435
+ method = 'GET' ,
1436
+ path = f'/bots/{ bot_id } /hasvoted/{ user_id } '
1437
+ )
1438
+
1439
+ def get_guild_stats (self , guild_id : str ) -> HTTPResponse :
1440
+ """|httpres|\n
1441
+ Gets the guild's stats listed on this service.
1442
+ Parameters
1443
+ -----------
1444
+ guild_id: :class:`str`
1445
+ The guild's ID.
1446
+ """
1447
+ return self ._request (
1448
+ method = 'GET' ,
1449
+ path = f'/guilds/{ bot_id } /stats' ,
1450
+ )
1451
+
1452
+ def user_voted_guild (self , guild_id : str , user_id : str ) -> HTTPResponse :
1453
+ """|httpres|\n
1454
+ Checks whether or not a user has voted for a guild on this service.
1455
+ Parameters
1456
+ -----------
1457
+ guild_id: :class:`str`
1458
+ The guild's ID.
1459
+ user_id: :class:`str`
1460
+ The user's ID.
1461
+ """
1462
+ return self ._request (
1463
+ method = 'GET' ,
1464
+ path = f'/guilds/{ bot_id } /hasvoted/{ user_id } '
1465
+ )
1466
+
1379
1467
class GlennBotList (Service ):
1380
1468
"""
1381
1469
Represents the Glenn Bot List service.
@@ -2132,6 +2220,6 @@ def get_unverified_bots(self) -> HTTPResponse:
2132
2220
Service .SERVICES = [
2133
2221
Arcane , Blist , BotListSpace , BotsDataBase , BotsForDiscord , BotsOnDiscord , Carbon ,
2134
2222
DBLista , DiscordBotsCo , DiscordBotsGG , DiscordAppsDev , DiscordBoats ,
2135
- DiscordBotList , DiscordBotWorld , DiscordExtremeList , DiscordLabs , GlennBotList ,
2136
- LBots , ListMyBots , MythicalBots , SpaceBotsList , TopGG , WonderBotList , YABL
2223
+ DiscordBotList , DiscordBotWorld , DiscordExtremeList , DiscordLabs , DiscordListology ,
2224
+ GlennBotList , LBots , ListMyBots , MythicalBots , SpaceBotsList , TopGG , WonderBotList , YABL
2137
2225
]
0 commit comments