From dc6493fc421db69bce4105b2425280cc74f1d3e8 Mon Sep 17 00:00:00 2001 From: kwzrd Date: Sat, 4 Apr 2020 01:10:54 +0200 Subject: Try to fetch devlog channel if not found in cache --- bot/bot.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'bot/bot.py') diff --git a/bot/bot.py b/bot/bot.py index d18805dd..4f238df8 100644 --- a/bot/bot.py +++ b/bot/bot.py @@ -153,8 +153,12 @@ class SeasonalBot(commands.Bot): devlog = self.get_channel(Channels.devlog) if not devlog: - log.warning("Log failed to send. Devlog channel not found.") - return + log.info(f"Fetching devlog channel as it wasn't found in the cache (ID: {Channels.devlog})") + try: + devlog = await self.fetch_channel(Channels.devlog) + except discord.HTTPException as discord_exc: + log.exception("Fetch failed", exc_info=discord_exc) + return if not icon: icon = self.user.avatar_url_as(format="png") -- cgit v1.2.3