This commit is contained in:
2025-02-19 16:41:05 +01:00
parent fa82c96e79
commit dc3abeb429

View File

@@ -154,8 +154,12 @@ class MessagesProc:
def get_message_history_with_thread(cls, message_id: str, thread_id: str | None = None) -> list[dict]: def get_message_history_with_thread(cls, message_id: str, thread_id: str | None = None) -> list[dict]:
logger.info(f"HISTORY: {cls.MESSAGE_HISTORY}") logger.info(f"HISTORY: {cls.MESSAGE_HISTORY}")
return [m for m in cls.MESSAGE_HISTORY if m["thread_id"] == thread_id] + \ if thread_id is not None:
[m for m in cls.MESSAGE_HISTORY if m["id"] == message_id] thread_messages = [m for m in cls.MESSAGE_HISTORY if m["thread_id"] == thread_id]
else:
thread_messages = []
return thread_messages + [m for m in cls.MESSAGE_HISTORY if m["id"] == message_id]
@classmethod @classmethod
async def on_message(cls, event: MessageEvent): async def on_message(cls, event: MessageEvent):