Skip to content

Commit bbd0665

Browse files
style: use absolute urls for each request
we set a base url, we should use a consistent style for these urls
1 parent cc4c732 commit bbd0665

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

botstrap.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class DiscordClient(Client):
7272

7373
def __init__(self, guild_id: int | str):
7474
super().__init__(
75-
base_url="https://discord.com/api/v10",
75+
base_url="https://discord.com/api/v10/",
7676
headers={"Authorization": f"Bot {BOT_TOKEN}"},
7777
event_hooks={"response": [self._raise_for_status]},
7878
)
@@ -212,14 +212,14 @@ def get_all_channels_and_categories(self) -> tuple[dict[str, str], dict[str, str
212212

213213
def get_all_guild_webhooks(self) -> list[dict[str, Any]]:
214214
"""Lists all the webhooks for the guild."""
215-
response = self.get(f"guilds/{self.guild_id}/webhooks")
215+
response = self.get(f"/guilds/{self.guild_id}/webhooks")
216216
return response.json()
217217

218218
def create_webhook(self, name: str, channel_id_: int) -> str:
219219
"""Creates a new webhook for a particular channel."""
220220
payload = {"name": name}
221221

222-
response = self.post(f"channels/{channel_id_}/webhooks", json=payload)
222+
response = self.post(f"/channels/{channel_id_}/webhooks", json=payload)
223223
new_webhook = response.json()
224224
return new_webhook["id"]
225225

0 commit comments

Comments
 (0)