@@ -1892,6 +1892,52 @@ def get_bot(self, bot_id: str) -> HTTPResponse:
1892
1892
path = f'/bots/{ bot_id } '
1893
1893
)
1894
1894
1895
+ class TopCord (Service ):
1896
+ """
1897
+ Represents the TopCord service.
1898
+
1899
+ .. seealso::
1900
+ - `TopCord Website <https://topcord.xyz/>`_
1901
+ - `TopCord API Documentation <https://docs.topcord.xyz/#/API>`_
1902
+ """
1903
+
1904
+ BASE_URL = 'https://topcord.xyz/api'
1905
+
1906
+ @staticmethod
1907
+ def aliases () -> list :
1908
+ return ['topcord' , 'topcord.xyz' ]
1909
+
1910
+ @staticmethod
1911
+ def _post (
1912
+ http_client : HTTPClient , bot_id : str , token : str ,
1913
+ server_count = 0 , user_count = 0 ,
1914
+ voice_connections = 0 , shard_count : int = None ,
1915
+ shard_id : int = None
1916
+ ) -> HTTPResponse :
1917
+ payload = { 'guilds' : server_count }
1918
+ if shard_id and shard_count :
1919
+ payload ['shards' ] = shard_count
1920
+ return http_client .request (
1921
+ method = 'POST' ,
1922
+ path = f'{ TopCord .BASE_URL } /bot/stats/{ bot_id } ' ,
1923
+ headers = { 'Authorization' : token },
1924
+ json = payload
1925
+ )
1926
+
1927
+ def get_bot (self , bot_id : str ) -> HTTPResponse :
1928
+ """|httpres|\n
1929
+ Gets the bot listed on this service.
1930
+
1931
+ Parameters
1932
+ -----------
1933
+ bot_id: :class:`str`
1934
+ The bot's ID.
1935
+ """
1936
+ return self ._request (
1937
+ method = 'GET' ,
1938
+ path = f'/bot/{ bot_id } ' ,
1939
+ )
1940
+
1895
1941
class TopGG (Service ):
1896
1942
"""
1897
1943
Represents the Top.gg service.
@@ -2221,5 +2267,5 @@ def get_unverified_bots(self) -> HTTPResponse:
2221
2267
Arcane , Blist , BotListSpace , BotsDataBase , BotsForDiscord , BotsOnDiscord , Carbon ,
2222
2268
DBLista , DiscordBotsCo , DiscordBotsGG , DiscordAppsDev , DiscordBoats ,
2223
2269
DiscordBotList , DiscordBotWorld , DiscordExtremeList , DiscordLabs , DiscordListology ,
2224
- GlennBotList , LBots , ListMyBots , MythicalBots , SpaceBotsList , TopGG , WonderBotList , YABL
2270
+ GlennBotList , LBots , ListMyBots , MythicalBots , SpaceBotsList , TopCord , TopGG , WonderBotList , YABL
2225
2271
]
0 commit comments