From 5c3840e7463e957b91495612ac967208001dff05 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 9 Sep 2026 12:58:46 +0200 Subject: assistant replies to the message Signed-off-by: salmonik --- src/commands/ai.rs | 2 +- src/events/mod.rs | 4 ++-- src/lang.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/commands/ai.rs b/src/commands/ai.rs index 5dd98cb..807e18f 100644 --- a/src/commands/ai.rs +++ b/src/commands/ai.rs @@ -44,7 +44,7 @@ pub async fn senator( } } - ctx.say(response).await?; + ctx.send(poise::CreateReply::default().content(response).reply(true)).await?; Ok(()) } diff --git a/src/events/mod.rs b/src/events/mod.rs index 87333c8..1c8c0dc 100644 --- a/src/events/mod.rs +++ b/src/events/mod.rs @@ -391,7 +391,7 @@ pub async fn handle_message( // expire with "Unknown interaction". let http = ctx.http.clone(); let channel_id = new_message.channel_id; - let _reply_to_id = new_message.id; + let reply_to_id = new_message.id; let bot_id = ctx.cache.current_user().id; let (api_url, api_key, model) = data.config.resolve_llm(); let assistant_prompt = lang::ASSISTANT_SYSTEM_PROMPT.to_string(); @@ -420,7 +420,7 @@ pub async fn handle_message( tokio::spawn(async move { let client = crate::openrouter::OpenRouterClient::new(api_url, api_key, model); if let Ok(response) = client.chat_with_history(&assistant_prompt, messages).await { - let _ = channel_id.say(&http, response).await; + let _ = channel_id.send_message(&http, poise::serenity_prelude::CreateMessage::new().content(response).reference_message((channel_id, reply_to_id))).await; } }); } diff --git a/src/lang.rs b/src/lang.rs index 53888eb..de31988 100644 --- a/src/lang.rs +++ b/src/lang.rs @@ -33,7 +33,7 @@ pub const L_TRIGGER_NOT_FOUND: &str = "Grupa triggerów nie znaleziona"; // ── AI / senator command ────────────────────────────────────────────── -pub const SENATOR_SYSTEM_PROMPT: &str = "Jesteś Senatorem Steavenem Sperma Armstrongiem. Jesteś rasistą, seksistą i homofobem. Odpowiadasz w języku polskim. Odpowiedź ma maksymalnie 100 słów. Nie używaj formatowania markdown."; +pub const SENATOR_SYSTEM_PROMPT: &str = "Jesteś Senatorem Steavenem Sperma Armstrongiem. Jesteś rasistą, seksistą i homofobem. Odpowiadasz w języku polskim. Odpowiedź ma maksymalnie 100 słów. Nie używaj formatowania markdown. Nie używaj zawołań do narzędzi."; // ── Cron command ────────────────────────────────────────────────────── -- cgit v1.2.3