From bcfa108779902340f8ed37b7cfa08a0a9017d144 Mon Sep 17 00:00:00 2001 From: Paillat Date: Tue, 31 Oct 2023 13:08:10 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(ChatProcess.py):=20fix=20con?= =?UTF-8?q?dition=20to=20check=20if=20original=20message=20exists=20before?= =?UTF-8?q?=20appending=20it=20to=20messages=20The=20condition=20to=20chec?= =?UTF-8?q?k=20if=20the=20original=20message=20exists=20before=20appending?= =?UTF-8?q?=20it=20to=20the=20messages=20list=20has=20been=20fixed.=20Prev?= =?UTF-8?q?iously,=20it=20was=20checking=20if=20the=20content=20of=20the?= =?UTF-8?q?=20last=20message=20in=20the=20list=20is=20equal=20to=20the=20c?= =?UTF-8?q?ontent=20of=20the=20original=20message,=20which=20could=20lead?= =?UTF-8?q?=20to=20incorrect=20behavior.=20Now,=20it=20properly=20checks?= =?UTF-8?q?=20if=20the=20original=20message=20object=20is=20not=20None=20b?= =?UTF-8?q?efore=20appending=20it=20to=20the=20messages=20list.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ChatProcess.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ChatProcess.py b/src/ChatProcess.py index 7686912..e7f63ca 100644 --- a/src/ChatProcess.py +++ b/src/ChatProcess.py @@ -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: