suppress AttributeError for on_message_edit
@@ -341,12 +341,15 @@ class Events:
self.bot.loop.create_task(self.channel_spam_check(message))
async def on_message_edit(self, message_before, message_after):
- if message_before.channel.name.endswith('nofilter'):
+ try:
+ if message_after.channel.name.endswith('nofilter'):
return
await self.bot.wait_until_all_ready()
if message_after.author == self.bot.server.me or self.bot.staff_role in message_after.author.roles or message_after.channel == self.bot.helpers_channel: # don't process messages by the bot or staff or in the helpers channel
return
await self.scan_message(message_after, is_edit=True)
+ except AttributeError:
+ pass # I need to figure this out eventually. at the moment there's no real harm doing this.
def setup(bot):
bot.add_cog(Events(bot))
