diff --git a/fjerkroa_bot/ai_responder.py b/fjerkroa_bot/ai_responder.py index 84815ca..abf321b 100644 --- a/fjerkroa_bot/ai_responder.py +++ b/fjerkroa_bot/ai_responder.py @@ -298,8 +298,8 @@ class AIResponder(AIResponderBase): async def memoize_reaction(self, message_user: str, reaction_user: str, operation: str, reaction: str, message: str) -> None: quoted_message = message.replace('\n', '\n> ') - await self.memoize(message_user, reaction_user, - f'> {quoted_message}', + await self.memoize(message_user, 'assistant', + f'\n> {quoted_message}', f'User {reaction_user} has {operation} this raction: {reaction}') async def send(self, message: AIMessage) -> AIResponse: diff --git a/fjerkroa_bot/discord_bot.py b/fjerkroa_bot/discord_bot.py index 98a19cd..651eff7 100644 --- a/fjerkroa_bot/discord_bot.py +++ b/fjerkroa_bot/discord_bot.py @@ -125,6 +125,11 @@ class FjerkroaBot(commands.Bot): async def on_reaction_clear(self, reaction, user): await self.on_reaction_operation(reaction, user, 'clearing') + async def on_message_edit(self, before, after): + await self.memoize(before.author.name, 'assistant', + '\n> ' + before.content.replace('\n', '\n> '), + 'User changed this message to:\n> ' + after.content.replace('\n', '\n> ')) + def on_config_file_modified(self, event): if event.src_path == self.config_file: new_config = self.load_config(self.config_file) diff --git a/openai_chat.dat b/openai_chat.dat index 3a0f5f4..6a1c066 100644 Binary files a/openai_chat.dat and b/openai_chat.dat differ