diff --git a/Cargo.lock b/Cargo.lock index 005acae..762202f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -51,9 +51,9 @@ dependencies = [ [[package]] name = "async-tungstenite" -version = "0.17.2" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1b71b31561643aa8e7df3effe284fa83ab1a840e52294c5f4bd7bfd8b2becbb" +checksum = "5682ea0913e5c20780fe5785abacb85a411e7437bf52a1bedb93ddb3972cb8dd" dependencies = [ "futures-io", "futures-util", @@ -120,6 +120,15 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array", +] + [[package]] name = "block-buffer" version = "0.10.2" @@ -169,7 +178,7 @@ dependencies = [ "num-integer", "num-traits", "serde", - "time 0.1.43", + "time", "winapi", ] @@ -185,8 +194,8 @@ dependencies = [ [[package]] name = "command_attr" -version = "0.4.0" -source = "git+https://github.com/serenity-rs/serenity?rev=c83ba2a1d61bf8e29638da26bab9f94dd0d90c0f#c83ba2a1d61bf8e29638da26bab9f94dd0d90c0f" +version = "0.3.8" +source = "git+https://github.com/jellywx/serenity?branch=jellywx-attachment_option#30daad4737b21ecc14f865289eba96143d0d6ca4" dependencies = [ "proc-macro2", "quote", @@ -296,17 +305,6 @@ checksum = "e77a43b28d0668df09411cb0bc9a8c2adc40f9a048afe863e05fd43251e8e39c" dependencies = [ "cfg-if", "num_cpus", -] - -[[package]] -name = "dashmap" -version = "5.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "391b56fbd302e585b7a9494fb70e40949567b1cf9003a8e4a6041a1687c26573" -dependencies = [ - "cfg-if", - "hashbrown 0.12.1", - "lock_api", "serde", ] @@ -321,13 +319,22 @@ dependencies = [ "pem-rfc7468", ] +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + [[package]] name = "digest" version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" dependencies = [ - "block-buffer", + "block-buffer 0.10.2", "crypto-common", ] @@ -559,19 +566,13 @@ dependencies = [ "ahash", ] -[[package]] -name = "hashbrown" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db0d4cf898abf0081f964436dc980e96670a0f36863e4b83aaacdb65c9d7ccc3" - [[package]] name = "hashlink" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7249a3129cbc1ffccd74857f81464a323a152173cdb134e0fd81bc803b29facf" dependencies = [ - "hashbrown 0.11.2", + "hashbrown", ] [[package]] @@ -706,7 +707,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee" dependencies = [ "autocfg", - "hashbrown 0.11.2", + "hashbrown", ] [[package]] @@ -946,21 +947,18 @@ dependencies = [ "libc", ] -[[package]] -name = "num_threads" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" -dependencies = [ - "libc", -] - [[package]] name = "once_cell" version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + [[package]] name = "openssl" version = "0.10.40" @@ -1006,15 +1004,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "ordered-float" -version = "2.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7940cf2ca942593318d07fcf2596cdca60a85c9e7fab408a5e21a4f9dcd40d87" -dependencies = [ - "num-traits", -] - [[package]] name = "parking_lot" version = "0.11.2" @@ -1270,7 +1259,7 @@ dependencies = [ "Inflector", "chrono", "chrono-tz", - "dashmap 4.0.2", + "dashmap", "dotenv", "env_logger", "humantime", @@ -1363,7 +1352,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cf22754c49613d2b3b119f0e5d46e34a2c628a937e3024b8762de4e7d8c710b" dependencies = [ "byteorder", - "digest", + "digest 0.10.3", "num-bigint-dig", "num-integer", "num-iter", @@ -1484,16 +1473,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "serde-value" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" -dependencies = [ - "ordered-float", - "serde", -] - [[package]] name = "serde_derive" version = "1.0.137" @@ -1530,31 +1509,28 @@ dependencies = [ [[package]] name = "serenity" -version = "0.11.1" -source = "git+https://github.com/serenity-rs/serenity?rev=c83ba2a1d61bf8e29638da26bab9f94dd0d90c0f#c83ba2a1d61bf8e29638da26bab9f94dd0d90c0f" +version = "0.10.10" +source = "git+https://github.com/jellywx/serenity?branch=jellywx-attachment_option#30daad4737b21ecc14f865289eba96143d0d6ca4" dependencies = [ "async-trait", "async-tungstenite", "base64", "bitflags", "bytes", - "cfg-if", "chrono", "command_attr", - "dashmap 5.3.3", + "dashmap", "flate2", "futures", "levenshtein", "mime", "mime_guess", - "parking_lot 0.12.0", + "parking_lot 0.11.2", "percent-encoding", "reqwest", "serde", - "serde-value", "serde_json", "static_assertions", - "time 0.3.9", "tokio", "tracing", "typemap_rev", @@ -1562,6 +1538,19 @@ dependencies = [ "uwl", ] +[[package]] +name = "sha-1" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + [[package]] name = "sha-1" version = "0.10.0" @@ -1570,7 +1559,7 @@ checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" dependencies = [ "cfg-if", "cpufeatures", - "digest", + "digest 0.10.3", ] [[package]] @@ -1581,7 +1570,7 @@ checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676" dependencies = [ "cfg-if", "cpufeatures", - "digest", + "digest 0.10.3", ] [[package]] @@ -1667,7 +1656,7 @@ dependencies = [ "chrono", "crc", "crossbeam-queue", - "digest", + "digest 0.10.3", "either", "event-listener", "futures-channel", @@ -1689,7 +1678,7 @@ dependencies = [ "rand 0.8.5", "rsa", "rustls 0.19.1", - "sha-1", + "sha-1 0.10.0", "sha2", "smallvec", "sqlformat", @@ -1818,18 +1807,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "time" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2702e08a7a860f005826c6815dcac101b19b5eb330c27fe4a5928fec1d20ddd" -dependencies = [ - "itoa", - "libc", - "num_threads", - "serde", -] - [[package]] name = "tinyvec" version = "1.6.0" @@ -1994,9 +1971,9 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "tungstenite" -version = "0.17.2" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96a2dea40e7570482f28eb57afbe42d97551905da6a9400acc5c328d24004f5" +checksum = "6ad3713a14ae247f22a728a0456a545df14acf3867f905adff84be99e23b3ad1" dependencies = [ "base64", "byteorder", @@ -2006,7 +1983,7 @@ dependencies = [ "log", "rand 0.8.5", "rustls 0.20.4", - "sha-1", + "sha-1 0.9.8", "thiserror", "url", "utf-8", diff --git a/Cargo.toml b/Cargo.toml index eb99f53..33bb093 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ serde_json = "1.0" rand = "0.7" Inflector = "0.11" levenshtein = "1.0" -serenity = { git = "https://github.com/serenity-rs/serenity", rev = "c83ba2a1d61bf8e29638da26bab9f94dd0d90c0f", features = ["collector", "unstable_discord_api"] } +serenity = { git = "https://github.com/jellywx/serenity", branch = "jellywx-attachment_option", features = ["collector", "unstable_discord_api"] } sqlx = { version = "0.5", features = ["runtime-tokio-rustls", "macros", "mysql", "bigdecimal", "chrono"]} [dependencies.regex_command_attr] diff --git a/src/main.rs b/src/main.rs index 3ab72b2..b22acaf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -48,11 +48,11 @@ use tokio::sync::RwLock; use chrono::Utc; use chrono_tz::Tz; +use serenity::model::gateway::GatewayIntents; use serenity::model::guild::UnavailableGuild; use serenity::model::prelude::{ InteractionApplicationCommandCallbackDataFlags, InteractionResponseType, }; -use serenity::prelude::GatewayIntents; struct GuildDataCache; @@ -303,7 +303,7 @@ DELETE FROM guilds WHERE guild = ? 1, ); - d.embed(|e| e.title(lm.get(&user_data.language, "timezone/set_p_title")) + d.create_embed(|e| e.title(lm.get(&user_data.language, "timezone/set_p_title")) .color(*THEME_COLOR) .description(content) .footer(|f| f.text(footer_text))) @@ -327,7 +327,7 @@ DELETE FROM guilds WHERE guild = ? .create_interaction_response(&ctx, |r| { r.kind(InteractionResponseType::ChannelMessageWithSource) .interaction_response_data(|d| { - d.embed(|e| { + d.create_embed(|e| { e.title( lm.get(&user_data.language, "lang/set_p_title"), ) @@ -357,7 +357,7 @@ async fn main() -> Result<(), Box> { let token = env::var("DISCORD_TOKEN").expect("Missing DISCORD_TOKEN from environment"); - let http = Http::new(&token); + let http = Http::new_with_token(&token); let logged_in_id = http .get_current_user() @@ -416,9 +416,8 @@ async fn main() -> Result<(), Box> { let framework_arc = Arc::new(framework); - let mut client = Client::builder( - &token, - if dm_enabled { + let mut client = Client::builder(&token) + .intents(if dm_enabled { GatewayIntents::GUILD_MESSAGES | GatewayIntents::GUILDS | GatewayIntents::GUILD_MESSAGE_REACTIONS @@ -428,13 +427,12 @@ async fn main() -> Result<(), Box> { GatewayIntents::GUILD_MESSAGES | GatewayIntents::GUILDS | GatewayIntents::GUILD_MESSAGE_REACTIONS - }, - ) - .application_id(application_id.0) - .event_handler(Handler) - .framework_arc(framework_arc.clone()) - .await - .expect("Error occurred creating client"); + }) + .application_id(application_id.0) + .event_handler(Handler) + .framework_arc(framework_arc.clone()) + .await + .expect("Error occurred creating client"); { let guild_data_cache = dashmap::DashMap::new();