Some of our cogs use the on_ready event to load the destination channel for the messages they relay or post. However, occasionally, the internal channel cache used by the get_channel method isn't ready at that point, resulting in the channel not being loaded and the Cog not working:
22608 | Jul 02 13:52:07 pd.beardfist.com Bot: | bot.cogs.reddit | WARNING | Couldn't locate a channel for subreddit relaying.
While this example is from the Reddit cog, the same thing happens intermittently with the bigbrother Cog as well. I've already added retry logic to the bigbrother cog in the Django rewrite, but a better solution would be to replace these get_channel methods by fetch_channel coroutines after we upgrade our discord.py version.
This will fetch the channels from the API, bypassing the problem with the internal channel cache entirely. It also has retry logic built-in.
Some of our cogs use the
on_readyevent to load the destination channel for the messages they relay or post. However, occasionally, the internal channel cache used by theget_channelmethod isn't ready at that point, resulting in the channel not being loaded and the Cog not working:While this example is from the Reddit cog, the same thing happens intermittently with the bigbrother Cog as well. I've already added retry logic to the bigbrother cog in the Django rewrite, but a better solution would be to replace these
get_channelmethods byfetch_channelcoroutines after we upgrade our discord.py version.This will fetch the channels from the API, bypassing the problem with the internal channel cache entirely. It also has retry logic built-in.