From 1f9467563908671e48010fa29fa2850a46289a84 Mon Sep 17 00:00:00 2001 From: Bulat Kurbanov Date: Tue, 18 Feb 2025 23:03:16 +0100 Subject: [PATCH] Update --- src/modules/stream_notifications/messages_proc.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/modules/stream_notifications/messages_proc.py b/src/modules/stream_notifications/messages_proc.py index 1a9b9db..c756363 100644 --- a/src/modules/stream_notifications/messages_proc.py +++ b/src/modules/stream_notifications/messages_proc.py @@ -154,9 +154,14 @@ class MessagesProc: reply_parent_message_id=event.message_id ) - if event.message.text.lower().startswith("!ai"): + if event.message.text.lower().startswith("!ai") or ( + event.reply and event.reply.parent_message_body.lower().startswith("!ai") + ): try: - completion = await get_completion(event.message.text.replace("!ai", "").strip()) + completion = await get_completion( + event.message.text.replace("!ai", "").strip(), + reply_to=event.reply.parent_message_body.replace("!ai", "").strip() if event.reply else None + ) max_length = 255 completion_parts = [completion[i:i + max_length] for i in range(0, len(completion), max_length)]