🐛 fix(ChatProcess.py): fix condition to check if original message exists before appending it to messages

The condition to check if the original message exists before appending it to the messages list has been fixed. Previously, it was checking if the content of the last message in the list is equal to the content of the original message, which could lead to incorrect behavior. Now, it properly checks if the original message object is not None before appending it to the messages list.
This commit is contained in:
2023-10-31 13:08:10 +01:00
parent eb89d4ee54
commit bcfa108779

View File

@@ -109,7 +109,7 @@ class Chat:
self.message.channel, 10, self.original_message
)
# if latst item id is not original message id, add original message to messages
if messages[-1].content != self.original_message.content:
if self.original_message != None:
messages.append(self.original_message)
self.context = []
for msg in messages: