aboutsummaryrefslogtreecommitdiffstats
path: root/src/events
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-09-09 12:58:46 +0200
committersalmonik <salmonik@tuta.io>2026-09-09 12:58:46 +0200
commit5c3840e7463e957b91495612ac967208001dff05 (patch)
tree15afaf75f707b1adf3fcf11a33eb60bb840c4442 /src/events
parentmake /grajcuj w\ compress finally work as compressing a file and then (diff)
downloadsenator-sperma-5c3840e7463e957b91495612ac967208001dff05.tar.gz
senator-sperma-5c3840e7463e957b91495612ac967208001dff05.zip
assistant replies to the message
Signed-off-by: salmonik <salmonik@tuta.io>
Diffstat (limited to '')
-rw-r--r--src/events/mod.rs4
1 files changed, 2 insertions, 2 deletions
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(
391 // expire with "Unknown interaction". 391 // expire with "Unknown interaction".
392 let http = ctx.http.clone(); 392 let http = ctx.http.clone();
393 let channel_id = new_message.channel_id; 393 let channel_id = new_message.channel_id;
394 let _reply_to_id = new_message.id; 394 let reply_to_id = new_message.id;
395 let bot_id = ctx.cache.current_user().id; 395 let bot_id = ctx.cache.current_user().id;
396 let (api_url, api_key, model) = data.config.resolve_llm(); 396 let (api_url, api_key, model) = data.config.resolve_llm();
397 let assistant_prompt = lang::ASSISTANT_SYSTEM_PROMPT.to_string(); 397 let assistant_prompt = lang::ASSISTANT_SYSTEM_PROMPT.to_string();
@@ -420,7 +420,7 @@ pub async fn handle_message(
420 tokio::spawn(async move { 420 tokio::spawn(async move {
421 let client = crate::openrouter::OpenRouterClient::new(api_url, api_key, model); 421 let client = crate::openrouter::OpenRouterClient::new(api_url, api_key, model);
422 if let Ok(response) = client.chat_with_history(&assistant_prompt, messages).await { 422 if let Ok(response) = client.chat_with_history(&assistant_prompt, messages).await {
423 let _ = channel_id.say(&http, response).await; 423 let _ = channel_id.send_message(&http, poise::serenity_prelude::CreateMessage::new().content(response).reference_message((channel_id, reply_to_id))).await;
424 } 424 }
425 }); 425 });
426 } 426 }