aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Shivansh-007 <[email protected]>2021-10-19 05:04:48 +0530
committerGravatar Shivansh-007 <[email protected]>2021-10-19 05:04:48 +0530
commit6402cc893833c2a03f8aca0048e674226e02cb72 (patch)
tree2549a9c7c3c25459559ff801b814565045fa6bda
parentAdd message creation timestamp to message link embed (diff)
Fix incident webhook fetch validation
-rw-r--r--bot/exts/moderation/incidents.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/bot/exts/moderation/incidents.py b/bot/exts/moderation/incidents.py
index 0b6b7ad9a..693c01c81 100644
--- a/bot/exts/moderation/incidents.py
+++ b/bot/exts/moderation/incidents.py
@@ -308,9 +308,10 @@ class Incidents(Cog):
async def fetch_webhook(self) -> None:
"""Fetch the incidents webhook object, so we can post message link embeds to it."""
await self.bot.wait_until_guild_available()
- self.incidents_webhook = await self.bot.fetch_webhook(Webhooks.incidents)
- if not self.incidents_webhook:
+ try:
+ self.incidents_webhook = await self.bot.fetch_webhook(Webhooks.incidents)
+ except discord.HTTPException:
log.error(f"Failed to fetch incidents webhook with id `{Webhooks.incidents}`.")
async def crawl_incidents(self) -> None: