@@ -420,6 +420,43 @@ def get_bot(self, bot_id: str, **query) -> HTTPResponse:
420
420
)
421
421
422
422
423
+ class DiscordBotList (Service ):
424
+ """
425
+ Represents the Discord Bot List service.
426
+
427
+ .. seealso::
428
+ - `Discord Bot List Website <https://discordbotlist.com/>`_
429
+ - `Discord Bot List API Documentation <https://discordbotlist.com/api-docs/>`_
430
+ """
431
+
432
+ BASE_URL = 'https://discordbotlist.com/api/v1'
433
+
434
+ @staticmethod
435
+ def aliases () -> list :
436
+ return ['discordbotlist' , 'discordbotlist.com' ]
437
+
438
+ @staticmethod
439
+ def _post (
440
+ http_client : HTTPClient , bot_id : str , token : str ,
441
+ server_count : int = 0 , user_count : int = 0 ,
442
+ voice_connections : int = 0 , shard_count : int = None ,
443
+ shard_id : int = None
444
+ ) -> HTTPResponse :
445
+ payload = {'guilds' : server_count }
446
+ if shard_id and shard_count :
447
+ payload ['shard_id' ] = shard_id
448
+ if user_count :
449
+ payload ['users' ] = user_count
450
+ if voice_connections :
451
+ payload ['voice_connections' ] = voice_connections
452
+ return http_client .request (
453
+ method = 'POST' ,
454
+ path = f'{ DiscordBotList .BASE_URL } /bots/{ bot_id } /stats' ,
455
+ headers = {'Authorization' : f'Bot { token } ' },
456
+ json = payload
457
+ )
458
+
459
+
423
460
class DiscordBoats (Service ):
424
461
"""
425
462
Represents the Discord Boats service.
@@ -508,43 +545,6 @@ def get_widget_url(self, bot_id: str, **query) -> str:
508
545
return f'{ DiscordBoats .BASE_URL } /widget/{ bot_id } .svg?{ _encode_query (query )} '
509
546
510
547
511
- class DiscordBotList (Service ):
512
- """
513
- Represents the Discord Bot List service.
514
-
515
- .. seealso::
516
- - `Discord Bot List Website <https://discordbotlist.com/>`_
517
- - `Discord Bot List API Documentation <https://discordbotlist.com/api-docs/>`_
518
- """
519
-
520
- BASE_URL = 'https://discordbotlist.com/api/v1'
521
-
522
- @staticmethod
523
- def aliases () -> list :
524
- return ['discordbotlist' , 'discordbotlist.com' ]
525
-
526
- @staticmethod
527
- def _post (
528
- http_client : HTTPClient , bot_id : str , token : str ,
529
- server_count : int = 0 , user_count : int = 0 ,
530
- voice_connections : int = 0 , shard_count : int = None ,
531
- shard_id : int = None
532
- ) -> HTTPResponse :
533
- payload = {'guilds' : server_count }
534
- if shard_id and shard_count :
535
- payload ['shard_id' ] = shard_id
536
- if user_count :
537
- payload ['users' ] = user_count
538
- if voice_connections :
539
- payload ['voice_connections' ] = voice_connections
540
- return http_client .request (
541
- method = 'POST' ,
542
- path = f'{ DiscordBotList .BASE_URL } /bots/{ bot_id } /stats' ,
543
- headers = {'Authorization' : f'Bot { token } ' },
544
- json = payload
545
- )
546
-
547
-
548
548
class DiscordExtremeList (Service ):
549
549
"""
550
550
Represents the Discord Extreme List service.
0 commit comments