diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 4dfb9c4..4ceb99b 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -8,7 +8,7 @@ use std::{ process::{Command, Stdio}, sync::{Arc, Mutex}, thread, - time::{SystemTime, UNIX_EPOCH}, + time::{Duration, SystemTime, UNIX_EPOCH}, }; #[cfg(target_os = "windows")] @@ -24,6 +24,8 @@ use tauri::{path::BaseDirectory, AppHandle, Emitter, Manager, State, WebviewWind const DEFAULT_MODEL: &str = "mistral:latest"; const OLLAMA_TAGS_URL: &str = "http://localhost:11434/api/tags"; const BACKEND_EXECUTABLE_NAME: &str = "yts-backend"; +const DISCORD_MAX_MESSAGE_LENGTH: usize = 2000; +const DISCORD_MESSAGE_DELAY_MS: u64 = 1000; const TARGET_TRIPLE: &str = env!("TAURI_BUILD_TARGET"); #[cfg(target_os = "windows")] const CREATE_NO_WINDOW: u32 = 0x0800_0000; @@ -74,6 +76,13 @@ struct TranslateSummaryRequest { prompt_template: Option, } +#[derive(Debug, Deserialize)] +#[serde(rename_all = "camelCase")] +struct SendSummaryToDiscordRequest { + id: i64, + webhook_url: String, +} + #[derive(Debug, Deserialize)] struct BackendSummaryMeta { timestamp: String,