@@ -264,6 +264,82 @@ def get_widget_url(self, bot_id: str, style = 1, **query) -> str:
264
264
"""
265
265
return f'https://api.botlist.space/widget/{ bot_id } /{ style } ?{ _encode_query (query )} '
266
266
267
+ class BotsDataBase (Service ):
268
+ """
269
+ Represents the BotsDataBase service.
270
+
271
+ .. seealso::
272
+ - `BotsDataBase Website <https://botsdatabase.com/>`_
273
+ - `BotsDataBase API Documentation <https://docs.botsdatabase.com/>`_
274
+ """
275
+
276
+ BASE_URL = 'https://api.botsdatabase.com/v1'
277
+
278
+ @staticmethod
279
+ def aliases () -> list :
280
+ return ['botsdatabase' , 'bdb' ]
281
+
282
+ @staticmethod
283
+ def _post (
284
+ http_client : HTTPClient , bot_id : str , token : str ,
285
+ server_count = 0 , user_count = 0 ,
286
+ voice_connections = 0 , shard_count : int = None ,
287
+ shard_id : int = None
288
+ ) -> HTTPResponse :
289
+ return http_client .request (
290
+ method = 'POST' ,
291
+ path = f'{ BotsDataBase .BASE_URL } /bots/{ bot_id } ' ,
292
+ headers = {
293
+ 'Authorization' : token ,
294
+ 'Content-Type' : 'application/json'
295
+ },
296
+ json = { 'servers' : server_count }
297
+ )
298
+
299
+ def get_user (self , user_id : str ) -> HTTPResponse :
300
+ """|httpres|\n
301
+ Gets the user listed on this service.
302
+
303
+ Parameters
304
+ -----------
305
+ user_id: :class:`str`
306
+ The user's ID.
307
+ """
308
+ return self ._request (
309
+ method = 'GET' ,
310
+ path = f'/users/{ user_id } '
311
+ )
312
+
313
+ def get_bot (self , user_id : str ) -> HTTPResponse :
314
+ """|httpres|\n
315
+ Gets the bot listed on this service.
316
+
317
+ Parameters
318
+ -----------
319
+ bot_id: :class:`str`
320
+ The bot's ID.
321
+ """
322
+ return self ._request (
323
+ method = 'GET' ,
324
+ path = f'/bots/{ user_id } '
325
+ )
326
+
327
+ def get_bot_votes (self , bot_id : str ) -> HTTPResponse :
328
+ """|httpres|\n
329
+ Gets the list of people who voted this bot on this service.
330
+
331
+ Parameters
332
+ -----------
333
+ bot_id: :class:`str`
334
+ The bot's ID.
335
+ """
336
+ return self ._request (
337
+ method = 'GET' ,
338
+ path = f'/bots/{ bot_id } /votes' ,
339
+ headers = { 'Authorization' : self .token },
340
+ requires_token = True
341
+ )
342
+
267
343
class BotsForDiscord (Service ):
268
344
"""
269
345
Represents the Bots For Discord service.
@@ -1869,7 +1945,7 @@ def get_unverified_bots(self) -> HTTPResponse:
1869
1945
)
1870
1946
1871
1947
Service .SERVICES = [
1872
- Arcane , BotListSpace , BotsForDiscord , BotsOnDiscord , Carbon ,
1948
+ Arcane , BotListSpace , BotsDataBase , BotsForDiscord , BotsOnDiscord , Carbon ,
1873
1949
DBLista , DiscordBotsGG , DiscordAppsDev , DiscordBoats ,
1874
1950
DiscordBotList , DiscordBotWorld , DiscordExtremeList , GlennBotList ,
1875
1951
LBots , ListMyBots , MythicalBots , SpaceBotsList , TopGG , WonderBotList , YABL
0 commit comments