mirror of
https://github.com/Paillat-dev/Botator.git
synced 2026-01-02 01:06:19 +00:00
🐛 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:
@@ -108,6 +108,9 @@ class Chat:
|
|||||||
messages: list[discord.Message] = await fetch_messages_history(
|
messages: list[discord.Message] = await fetch_messages_history(
|
||||||
self.message.channel, 10, self.original_message
|
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 = []
|
self.context = []
|
||||||
for msg in messages:
|
for msg in messages:
|
||||||
if msg.author.id == self.bot.user.id:
|
if msg.author.id == self.bot.user.id:
|
||||||
|
|||||||
Reference in New Issue
Block a user