downgrade some stuff

This commit is contained in:
jude 2022-05-13 14:38:36 +01:00
parent 0e7a4d02de
commit 1007b75069
3 changed files with 71 additions and 96 deletions

139
Cargo.lock generated
View File

@ -51,9 +51,9 @@ dependencies = [
[[package]] [[package]]
name = "async-tungstenite" name = "async-tungstenite"
version = "0.17.2" version = "0.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1b71b31561643aa8e7df3effe284fa83ab1a840e52294c5f4bd7bfd8b2becbb" checksum = "5682ea0913e5c20780fe5785abacb85a411e7437bf52a1bedb93ddb3972cb8dd"
dependencies = [ dependencies = [
"futures-io", "futures-io",
"futures-util", "futures-util",
@ -120,6 +120,15 @@ version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 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]] [[package]]
name = "block-buffer" name = "block-buffer"
version = "0.10.2" version = "0.10.2"
@ -169,7 +178,7 @@ dependencies = [
"num-integer", "num-integer",
"num-traits", "num-traits",
"serde", "serde",
"time 0.1.43", "time",
"winapi", "winapi",
] ]
@ -185,8 +194,8 @@ dependencies = [
[[package]] [[package]]
name = "command_attr" name = "command_attr"
version = "0.4.0" version = "0.3.8"
source = "git+https://github.com/serenity-rs/serenity?rev=c83ba2a1d61bf8e29638da26bab9f94dd0d90c0f#c83ba2a1d61bf8e29638da26bab9f94dd0d90c0f" source = "git+https://github.com/jellywx/serenity?branch=jellywx-attachment_option#30daad4737b21ecc14f865289eba96143d0d6ca4"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -296,17 +305,6 @@ checksum = "e77a43b28d0668df09411cb0bc9a8c2adc40f9a048afe863e05fd43251e8e39c"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"num_cpus", "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", "serde",
] ]
@ -321,13 +319,22 @@ dependencies = [
"pem-rfc7468", "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]] [[package]]
name = "digest" name = "digest"
version = "0.10.3" version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506"
dependencies = [ dependencies = [
"block-buffer", "block-buffer 0.10.2",
"crypto-common", "crypto-common",
] ]
@ -559,19 +566,13 @@ dependencies = [
"ahash", "ahash",
] ]
[[package]]
name = "hashbrown"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "db0d4cf898abf0081f964436dc980e96670a0f36863e4b83aaacdb65c9d7ccc3"
[[package]] [[package]]
name = "hashlink" name = "hashlink"
version = "0.7.0" version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7249a3129cbc1ffccd74857f81464a323a152173cdb134e0fd81bc803b29facf" checksum = "7249a3129cbc1ffccd74857f81464a323a152173cdb134e0fd81bc803b29facf"
dependencies = [ dependencies = [
"hashbrown 0.11.2", "hashbrown",
] ]
[[package]] [[package]]
@ -706,7 +707,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee" checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee"
dependencies = [ dependencies = [
"autocfg", "autocfg",
"hashbrown 0.11.2", "hashbrown",
] ]
[[package]] [[package]]
@ -946,21 +947,18 @@ dependencies = [
"libc", "libc",
] ]
[[package]]
name = "num_threads"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44"
dependencies = [
"libc",
]
[[package]] [[package]]
name = "once_cell" name = "once_cell"
version = "1.10.0" version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9"
[[package]]
name = "opaque-debug"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
[[package]] [[package]]
name = "openssl" name = "openssl"
version = "0.10.40" version = "0.10.40"
@ -1006,15 +1004,6 @@ dependencies = [
"vcpkg", "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]] [[package]]
name = "parking_lot" name = "parking_lot"
version = "0.11.2" version = "0.11.2"
@ -1270,7 +1259,7 @@ dependencies = [
"Inflector", "Inflector",
"chrono", "chrono",
"chrono-tz", "chrono-tz",
"dashmap 4.0.2", "dashmap",
"dotenv", "dotenv",
"env_logger", "env_logger",
"humantime", "humantime",
@ -1363,7 +1352,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4cf22754c49613d2b3b119f0e5d46e34a2c628a937e3024b8762de4e7d8c710b" checksum = "4cf22754c49613d2b3b119f0e5d46e34a2c628a937e3024b8762de4e7d8c710b"
dependencies = [ dependencies = [
"byteorder", "byteorder",
"digest", "digest 0.10.3",
"num-bigint-dig", "num-bigint-dig",
"num-integer", "num-integer",
"num-iter", "num-iter",
@ -1484,16 +1473,6 @@ dependencies = [
"serde_derive", "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]] [[package]]
name = "serde_derive" name = "serde_derive"
version = "1.0.137" version = "1.0.137"
@ -1530,31 +1509,28 @@ dependencies = [
[[package]] [[package]]
name = "serenity" name = "serenity"
version = "0.11.1" version = "0.10.10"
source = "git+https://github.com/serenity-rs/serenity?rev=c83ba2a1d61bf8e29638da26bab9f94dd0d90c0f#c83ba2a1d61bf8e29638da26bab9f94dd0d90c0f" source = "git+https://github.com/jellywx/serenity?branch=jellywx-attachment_option#30daad4737b21ecc14f865289eba96143d0d6ca4"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"async-tungstenite", "async-tungstenite",
"base64", "base64",
"bitflags", "bitflags",
"bytes", "bytes",
"cfg-if",
"chrono", "chrono",
"command_attr", "command_attr",
"dashmap 5.3.3", "dashmap",
"flate2", "flate2",
"futures", "futures",
"levenshtein", "levenshtein",
"mime", "mime",
"mime_guess", "mime_guess",
"parking_lot 0.12.0", "parking_lot 0.11.2",
"percent-encoding", "percent-encoding",
"reqwest", "reqwest",
"serde", "serde",
"serde-value",
"serde_json", "serde_json",
"static_assertions", "static_assertions",
"time 0.3.9",
"tokio", "tokio",
"tracing", "tracing",
"typemap_rev", "typemap_rev",
@ -1562,6 +1538,19 @@ dependencies = [
"uwl", "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]] [[package]]
name = "sha-1" name = "sha-1"
version = "0.10.0" version = "0.10.0"
@ -1570,7 +1559,7 @@ checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"cpufeatures", "cpufeatures",
"digest", "digest 0.10.3",
] ]
[[package]] [[package]]
@ -1581,7 +1570,7 @@ checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"cpufeatures", "cpufeatures",
"digest", "digest 0.10.3",
] ]
[[package]] [[package]]
@ -1667,7 +1656,7 @@ dependencies = [
"chrono", "chrono",
"crc", "crc",
"crossbeam-queue", "crossbeam-queue",
"digest", "digest 0.10.3",
"either", "either",
"event-listener", "event-listener",
"futures-channel", "futures-channel",
@ -1689,7 +1678,7 @@ dependencies = [
"rand 0.8.5", "rand 0.8.5",
"rsa", "rsa",
"rustls 0.19.1", "rustls 0.19.1",
"sha-1", "sha-1 0.10.0",
"sha2", "sha2",
"smallvec", "smallvec",
"sqlformat", "sqlformat",
@ -1818,18 +1807,6 @@ dependencies = [
"winapi", "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]] [[package]]
name = "tinyvec" name = "tinyvec"
version = "1.6.0" version = "1.6.0"
@ -1994,9 +1971,9 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642"
[[package]] [[package]]
name = "tungstenite" name = "tungstenite"
version = "0.17.2" version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d96a2dea40e7570482f28eb57afbe42d97551905da6a9400acc5c328d24004f5" checksum = "6ad3713a14ae247f22a728a0456a545df14acf3867f905adff84be99e23b3ad1"
dependencies = [ dependencies = [
"base64", "base64",
"byteorder", "byteorder",
@ -2006,7 +1983,7 @@ dependencies = [
"log", "log",
"rand 0.8.5", "rand 0.8.5",
"rustls 0.20.4", "rustls 0.20.4",
"sha-1", "sha-1 0.9.8",
"thiserror", "thiserror",
"url", "url",
"utf-8", "utf-8",

View File

@ -22,7 +22,7 @@ serde_json = "1.0"
rand = "0.7" rand = "0.7"
Inflector = "0.11" Inflector = "0.11"
levenshtein = "1.0" 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"]} sqlx = { version = "0.5", features = ["runtime-tokio-rustls", "macros", "mysql", "bigdecimal", "chrono"]}
[dependencies.regex_command_attr] [dependencies.regex_command_attr]

View File

@ -48,11 +48,11 @@ use tokio::sync::RwLock;
use chrono::Utc; use chrono::Utc;
use chrono_tz::Tz; use chrono_tz::Tz;
use serenity::model::gateway::GatewayIntents;
use serenity::model::guild::UnavailableGuild; use serenity::model::guild::UnavailableGuild;
use serenity::model::prelude::{ use serenity::model::prelude::{
InteractionApplicationCommandCallbackDataFlags, InteractionResponseType, InteractionApplicationCommandCallbackDataFlags, InteractionResponseType,
}; };
use serenity::prelude::GatewayIntents;
struct GuildDataCache; struct GuildDataCache;
@ -303,7 +303,7 @@ DELETE FROM guilds WHERE guild = ?
1, 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) .color(*THEME_COLOR)
.description(content) .description(content)
.footer(|f| f.text(footer_text))) .footer(|f| f.text(footer_text)))
@ -327,7 +327,7 @@ DELETE FROM guilds WHERE guild = ?
.create_interaction_response(&ctx, |r| { .create_interaction_response(&ctx, |r| {
r.kind(InteractionResponseType::ChannelMessageWithSource) r.kind(InteractionResponseType::ChannelMessageWithSource)
.interaction_response_data(|d| { .interaction_response_data(|d| {
d.embed(|e| { d.create_embed(|e| {
e.title( e.title(
lm.get(&user_data.language, "lang/set_p_title"), lm.get(&user_data.language, "lang/set_p_title"),
) )
@ -357,7 +357,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
let token = env::var("DISCORD_TOKEN").expect("Missing DISCORD_TOKEN from environment"); 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 let logged_in_id = http
.get_current_user() .get_current_user()
@ -416,9 +416,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
let framework_arc = Arc::new(framework); let framework_arc = Arc::new(framework);
let mut client = Client::builder( let mut client = Client::builder(&token)
&token, .intents(if dm_enabled {
if dm_enabled {
GatewayIntents::GUILD_MESSAGES GatewayIntents::GUILD_MESSAGES
| GatewayIntents::GUILDS | GatewayIntents::GUILDS
| GatewayIntents::GUILD_MESSAGE_REACTIONS | GatewayIntents::GUILD_MESSAGE_REACTIONS
@ -428,13 +427,12 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
GatewayIntents::GUILD_MESSAGES GatewayIntents::GUILD_MESSAGES
| GatewayIntents::GUILDS | GatewayIntents::GUILDS
| GatewayIntents::GUILD_MESSAGE_REACTIONS | GatewayIntents::GUILD_MESSAGE_REACTIONS
}, })
) .application_id(application_id.0)
.application_id(application_id.0) .event_handler(Handler)
.event_handler(Handler) .framework_arc(framework_arc.clone())
.framework_arc(framework_arc.clone()) .await
.await .expect("Error occurred creating client");
.expect("Error occurred creating client");
{ {
let guild_data_cache = dashmap::DashMap::new(); let guild_data_cache = dashmap::DashMap::new();