I'm having an issue where this code runs before the bot connects to discord causing
AttributeError: 'NoneType' object has no attribute 'invites'
when it gets to await guild.invites().
I tried catching the AttributeError but it still broke the loop.
The only solution I've found is to load the cog using load_extension() after the bot has already connected to discord. Is there a way I can have that load after the bot has connected or not break the loop when I catch the exception?