diff --git a/discord_bot.py b/discord_bot.py index 49d1b74..3b296b7 100644 --- a/discord_bot.py +++ b/discord_bot.py @@ -32,16 +32,16 @@ def begin(self): async def checkMarvinActions(self, message): """Check if Marvin should perform any actions""" words = self.tokenize(message.content) - if self.user.name.lower() in words: + if self.user.mentioned_in(message) or self.user.name.lower() in words: for action in self.ACTIONS: response = action(words) if response: - await message.channel.send(response) + await message.reply(response) else: for action in self.GENERAL_ACTIONS: response = action(words) if response: - await message.channel.send(response) + await message.reply(response) async def on_message(self, message): """Hook run on every message""" @@ -50,3 +50,7 @@ async def on_message(self, message): # don't react to own messages return await self.checkMarvinActions(message) + + async def on_message_edit(self, _, after): + """Hook run on every edited message""" + await self.on_message(after)