diff options
author | 2021-10-19 05:04:48 +0530 | |
---|---|---|
committer | 2021-10-19 05:04:48 +0530 | |
commit | 6402cc893833c2a03f8aca0048e674226e02cb72 (patch) | |
tree | 2549a9c7c3c25459559ff801b814565045fa6bda | |
parent | Add message creation timestamp to message link embed (diff) |
Fix incident webhook fetch validation
-rw-r--r-- | bot/exts/moderation/incidents.py | 5 |
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: |