Skip to content

Commit 1185ce8

Browse files
committed
chore: reorder services
1 parent fc9f3bb commit 1185ce8

File tree

2 files changed

+40
-40
lines changed

2 files changed

+40
-40
lines changed

dbots/service.py

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,43 @@ def get_bot(self, bot_id: str, **query) -> HTTPResponse:
420420
)
421421

422422

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+
423460
class DiscordBoats(Service):
424461
"""
425462
Represents the Discord Boats service.
@@ -508,43 +545,6 @@ def get_widget_url(self, bot_id: str, **query) -> str:
508545
return f'{DiscordBoats.BASE_URL}/widget/{bot_id}.svg?{_encode_query(query)}'
509546

510547

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-
548548
class DiscordExtremeList(Service):
549549
"""
550550
Represents the Discord Extreme List service.

docs/api.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@ Services
5555
.. autoclass:: Carbon
5656
:members:
5757

58-
.. autoclass:: DiscordBotsGG
59-
:members:
60-
6158
.. autoclass:: DiscordBoats
6259
:members:
6360

6461
.. autoclass:: DiscordBotList
6562
:members:
6663

64+
.. autoclass:: DiscordBotsGG
65+
:members:
66+
6767
.. autoclass:: DiscordExtremeList
6868
:members:
6969

0 commit comments

Comments
 (0)