diff options
author | 2020-04-04 00:20:43 +0100 | |
---|---|---|
committer | 2020-04-04 00:20:43 +0100 | |
commit | 38d0098b0f2dce38e032be235b6dd2f1e2109b4a (patch) | |
tree | f55458f58c4f8275aee4d05dc7f04102bdb063e8 /bot/bot.py | |
parent | Merge pull request #391 from python-discord/greeting-message (diff) | |
parent | Try to fetch devlog channel if not found in cache (diff) |
Merge pull request #392 from python-discord/fetch-devlog-channel
Try to fetch devlog channel if not found in cache
Diffstat (limited to 'bot/bot.py')
-rw-r--r-- | bot/bot.py | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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") |