🐛 fix(ChatProcess.py): add original message to messages if the latest item id is not the same as the original message id

The original message is now added to the list of messages if the latest item id is not the same as the id of the original message. This ensures that the original message is included in the context for further processing.
This commit is contained in:
2023-10-31 12:29:37 +01:00
parent 73ec66deaa
commit be4e54a6b7

View File

@@ -108,6 +108,9 @@ class Chat:
messages: list[discord.Message] = await fetch_messages_history(
self.message.channel, 10, self.original_message
)
#if latst item id is not original message id, add original message to messages
if messages[-1].id != self.original_message.id:
messages.append(self.original_message)
self.context = []
for msg in messages:
if msg.author.id == self.bot.user.id: