scan message edits too
@@ -11,7 +11,7 @@ class Events:
self.bot = bot
print('Addon "{}" loaded'.format(self.__class__.__name__))
- async def on_message(self, message):
+ async def scan_message(self, message):
if message.author == self.bot.server.me: # don't process messages by the bot
return
msg = message.content.lower()
@@ -24,5 +24,11 @@ class Events:
await self.bot.delete_message(message)
await self.bot.send_message(self.bot.mods_channel, "**Bad URL**: {} posted a freeShop URL in {} (message deleted)".format(message.author.mention, message.channel.mention))
+ async def on_message(self, message):
+ await self.scan_message(message)
+
+ async def on_message_edit(self, message_before, message_after):
+ await self.scan_message(message_after)
+
def setup(bot):
bot.add_cog(Events(bot))
