Skip to content

Commit fd3ea04

Browse files
authored
Update DiscordExtremeList to v2 (#2)
1 parent cf67bcc commit fd3ea04

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

dbots/service.py

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ class DiscordExtremeList(Service):
10191019
- `Discord Extreme List API Documentation <https://docs.discordextremelist.xyz/>`_
10201020
"""
10211021

1022-
BASE_URL = 'https://api.discordextremelist.xyz/v1'
1022+
BASE_URL = 'https://api.discordextremelist.xyz/v2'
10231023

10241024
@staticmethod
10251025
def aliases() -> list:
@@ -1032,11 +1032,14 @@ def _post(
10321032
voice_connections = 0, shard_count: int = None,
10331033
shard_id: int = None
10341034
) -> HTTPResponse:
1035+
payload = { 'guildCount': server_count }
1036+
if shard_id and shard_count:
1037+
payload['shardCount'] = shard_count
10351038
return http_client.request(
10361039
method = 'POST',
1037-
path = f'{DiscordExtremeList.BASE_URL}/bot/{bot_id}',
1040+
path = f'{DiscordExtremeList.BASE_URL}/bot/{bot_id}/stats',
10381041
headers = { 'Authorization': token },
1039-
json = { 'guildCount': server_count }
1042+
json = payload
10401043
)
10411044

10421045
def get_statistics(self) -> HTTPResponse:
@@ -1112,19 +1115,6 @@ def get_user(self, user_id: str) -> HTTPResponse:
11121115
requires_token = True
11131116
)
11141117

1115-
def get_widget_url(self, bot_id: str, **query) -> str:
1116-
"""
1117-
Gets the widget URL for this bot.
1118-
1119-
Parameters
1120-
-----------
1121-
bot_id: :class:`str`
1122-
The bot's ID.
1123-
**query
1124-
The query string to append to the URL.
1125-
"""
1126-
return f'{DiscordExtremeList.BASE_URL}/bot/{bot_id}/widget?{_encode_query(query)}'
1127-
11281118
class GlennBotList(Service):
11291119
"""
11301120
Represents the Glenn Bot List service.

0 commit comments

Comments
 (0)