diff --git a/.vscode/settings.json b/.vscode/settings.json index cbac779..660eb93 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,3 @@ { - "rust-analyzer.hover.actions.references.enable": true, "rust-analyzer.check.command": "clippy" } \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index 872922e..0ba3d03 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,33 +7,33 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -serde_json = "1.0.95" -serde = { version = "1.0.159", features = ["derive"] } -regex = "1.7.3" +serde_json = "1.0.102" +serde = { version = "1.0.171", features = ["derive"] } +regex = "1.9.1" urlencoding = "2.1.2" sqlx = { version = "0.6.3", features = ["runtime-tokio-rustls", "sqlite", "offline"] } -meilisearch-sdk = "0.23.0" -words-count = "0.1.4" +meilisearch-sdk = "0.23.2" +words-count = "0.1.5" html-escape = "0.2.13" piston_rs = "0.4.3" -async-trait = "0.1.68" +async-trait = "0.1.71" duplicate = "1.0.0" -base64 = "0.21.0" -once_cell = "1.17.1" +base64 = "0.21.2" +once_cell = "1.18.0" color-eyre = "0.6.2" -tracing-subscriber = { version = "0.3.16", features = ["env-filter"] } +tracing-subscriber = { version = "0.3.17", features = ["env-filter"] } tracing = "0.1.37" tracing-error = "0.2.0" -toml = "0.7.3" -url = "2.3.1" +toml = "0.7.6" +url = "2.4.0" fastrand = "1.9.0" -openai = "1.0.0-alpha.8" +openai = { git = "https://github.com/rellfy/openai", rev = "280cf412581d6c5b8e239ce19ae647b877e01838" } sysinfo = "0.28.4" [dependencies.reqwest] default-features = false features = ["rustls-tls", "json"] -version = "0.11.16" +version = "0.11.18" [dependencies.serenity] git = "https://github.com/serenity-rs/serenity" @@ -43,10 +43,10 @@ features = ["client", "unstable_discord_api", "gateway", "rustls_backend", "mode #version = "0.10.10" [dependencies.tokio] -version = "1.27.0" +version = "1.29.1" features = ["macros", "rt-multi-thread", "process"] [dependencies.anyhow] -version = "1.0.70" +version = "1.0.71" features = ["backtrace"] diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 5d56faf..56f033b 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly" +channel = "nightly-2023-06-27" diff --git a/src/utils/index_threads.rs b/src/utils/index_threads.rs index dce97de..0df558a 100644 --- a/src/utils/index_threads.rs +++ b/src/utils/index_threads.rs @@ -22,6 +22,7 @@ pub struct Thread { pub author_id: u64, pub id: u64, pub guild_id: u64, + pub parent_channel_id: u64, pub timestamp: i64, pub date: Timestamp, @@ -72,8 +73,10 @@ pub async fn index_thread_messages( .await? .user .face(); + // Get tags // TODO: How to optimize this, and better visualize this problem in mind, ask Thomas. + // IDEA: Map available_tags into a hashmap, id to key and tag to value. let thread_available_tags = thread_parent_channel_id .to_channel(&ctx.http) .await?