mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-04-19 08:48:54 +00:00
Update serenity and make prelude compile
This commit is contained in:
parent
a6d1259362
commit
3f115eaab0
8 changed files with 363 additions and 32 deletions
311
Cargo.lock
generated
311
Cargo.lock
generated
|
@ -87,6 +87,15 @@ version = "1.0.79"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca"
|
checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "arrayvec"
|
||||||
|
version = "0.7.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711"
|
||||||
|
dependencies = [
|
||||||
|
"serde",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "async-trait"
|
name = "async-trait"
|
||||||
version = "0.1.77"
|
version = "0.1.77"
|
||||||
|
@ -110,7 +119,7 @@ dependencies = [
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-rustls 0.23.4",
|
"tokio-rustls 0.23.4",
|
||||||
"tungstenite",
|
"tungstenite 0.17.3",
|
||||||
"webpki-roots 0.22.6",
|
"webpki-roots 0.22.6",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -222,6 +231,12 @@ version = "3.14.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec"
|
checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "bytecount"
|
||||||
|
version = "0.6.7"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e1e5f035d16fc623ae5f74981db80a439803888314e3a555fd6f04acd51a3205"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "byteorder"
|
name = "byteorder"
|
||||||
version = "1.5.0"
|
version = "1.5.0"
|
||||||
|
@ -255,6 +270,37 @@ dependencies = [
|
||||||
"pkg-config",
|
"pkg-config",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "camino"
|
||||||
|
version = "1.1.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c"
|
||||||
|
dependencies = [
|
||||||
|
"serde",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cargo-platform"
|
||||||
|
version = "0.1.7"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "694c8807f2ae16faecc43dc17d74b3eb042482789fd0eb64b39a2e04e087053f"
|
||||||
|
dependencies = [
|
||||||
|
"serde",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cargo_metadata"
|
||||||
|
version = "0.14.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa"
|
||||||
|
dependencies = [
|
||||||
|
"camino",
|
||||||
|
"cargo-platform",
|
||||||
|
"semver",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cc"
|
name = "cc"
|
||||||
version = "1.0.83"
|
version = "1.0.83"
|
||||||
|
@ -321,6 +367,17 @@ dependencies = [
|
||||||
"syn 1.0.109",
|
"syn 1.0.109",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "command_attr"
|
||||||
|
version = "0.5.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "32f08c85a02e066b7b4f7dcb60eee6ae0793ef7d6452a3547d1f19665df070a9"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn 1.0.109",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "const-oid"
|
name = "const-oid"
|
||||||
version = "0.9.6"
|
version = "0.9.6"
|
||||||
|
@ -382,6 +439,15 @@ dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "crossbeam-channel"
|
||||||
|
version = "0.5.11"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b"
|
||||||
|
dependencies = [
|
||||||
|
"crossbeam-utils",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "crossbeam-queue"
|
name = "crossbeam-queue"
|
||||||
version = "0.3.11"
|
version = "0.3.11"
|
||||||
|
@ -421,6 +487,12 @@ dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "data-encoding"
|
||||||
|
version = "2.5.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "der"
|
name = "der"
|
||||||
version = "0.7.8"
|
version = "0.7.8"
|
||||||
|
@ -513,6 +585,15 @@ dependencies = [
|
||||||
"windows-sys 0.52.0",
|
"windows-sys 0.52.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "error-chain"
|
||||||
|
version = "0.12.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2d2f06b9cac1506ece98fe3231e3cc9c4410ec3d5b1f24ae1c8946f0742cdefc"
|
||||||
|
dependencies = [
|
||||||
|
"version_check",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "etcetera"
|
name = "etcetera"
|
||||||
version = "0.8.0"
|
version = "0.8.0"
|
||||||
|
@ -705,6 +786,15 @@ dependencies = [
|
||||||
"slab",
|
"slab",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "fxhash"
|
||||||
|
version = "0.2.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c"
|
||||||
|
dependencies = [
|
||||||
|
"byteorder",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "generic-array"
|
name = "generic-array"
|
||||||
version = "0.14.7"
|
version = "0.14.7"
|
||||||
|
@ -734,6 +824,12 @@ version = "0.28.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253"
|
checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "glob"
|
||||||
|
version = "0.3.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "h2"
|
name = "h2"
|
||||||
version = "0.3.24"
|
version = "0.3.24"
|
||||||
|
@ -1135,6 +1231,21 @@ dependencies = [
|
||||||
"unicase",
|
"unicase",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "mini-moka"
|
||||||
|
version = "0.10.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c325dfab65f261f386debee8b0969da215b3fa0037e74c8a1234db7ba986d803"
|
||||||
|
dependencies = [
|
||||||
|
"crossbeam-channel",
|
||||||
|
"crossbeam-utils",
|
||||||
|
"dashmap",
|
||||||
|
"skeptic",
|
||||||
|
"smallvec",
|
||||||
|
"tagptr",
|
||||||
|
"triomphe",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "minimal-lexical"
|
name = "minimal-lexical"
|
||||||
version = "0.2.1"
|
version = "0.2.1"
|
||||||
|
@ -1495,6 +1606,17 @@ dependencies = [
|
||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pulldown-cmark"
|
||||||
|
version = "0.9.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "57206b407293d2bcd3af849ce869d52068623f19e1b5ff8e8778e3309439682b"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags 2.4.2",
|
||||||
|
"memchr",
|
||||||
|
"unicase",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "quote"
|
name = "quote"
|
||||||
version = "1.0.35"
|
version = "1.0.35"
|
||||||
|
@ -1796,6 +1918,15 @@ version = "1.0.16"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c"
|
checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "same-file"
|
||||||
|
version = "1.0.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
|
||||||
|
dependencies = [
|
||||||
|
"winapi-util",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "schannel"
|
name = "schannel"
|
||||||
version = "0.1.23"
|
version = "0.1.23"
|
||||||
|
@ -1821,6 +1952,16 @@ dependencies = [
|
||||||
"untrusted 0.9.0",
|
"untrusted 0.9.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "secrecy"
|
||||||
|
version = "0.8.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e"
|
||||||
|
dependencies = [
|
||||||
|
"serde",
|
||||||
|
"zeroize",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "security-framework"
|
name = "security-framework"
|
||||||
version = "2.9.2"
|
version = "2.9.2"
|
||||||
|
@ -1844,6 +1985,15 @@ dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "semver"
|
||||||
|
version = "1.0.21"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0"
|
||||||
|
dependencies = [
|
||||||
|
"serde",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.196"
|
version = "1.0.196"
|
||||||
|
@ -1922,7 +2072,7 @@ dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"chrono",
|
"chrono",
|
||||||
"command_attr",
|
"command_attr 0.4.2",
|
||||||
"dashmap",
|
"dashmap",
|
||||||
"flate2",
|
"flate2",
|
||||||
"futures",
|
"futures",
|
||||||
|
@ -1940,7 +2090,43 @@ dependencies = [
|
||||||
"time",
|
"time",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tracing",
|
"tracing",
|
||||||
"typemap_rev",
|
"typemap_rev 0.1.5",
|
||||||
|
"url",
|
||||||
|
"uwl",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "serenity"
|
||||||
|
version = "0.12.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "385647faa24a889929028973650a4f158fb1b4272b2fcf94feb9fcc3c009e813"
|
||||||
|
dependencies = [
|
||||||
|
"arrayvec",
|
||||||
|
"async-trait",
|
||||||
|
"base64 0.21.7",
|
||||||
|
"bitflags 2.4.2",
|
||||||
|
"bytes",
|
||||||
|
"chrono",
|
||||||
|
"command_attr 0.5.1",
|
||||||
|
"dashmap",
|
||||||
|
"flate2",
|
||||||
|
"futures",
|
||||||
|
"fxhash",
|
||||||
|
"levenshtein",
|
||||||
|
"mime_guess",
|
||||||
|
"parking_lot",
|
||||||
|
"percent-encoding",
|
||||||
|
"reqwest",
|
||||||
|
"secrecy",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"static_assertions",
|
||||||
|
"time",
|
||||||
|
"tokio",
|
||||||
|
"tokio-tungstenite",
|
||||||
|
"tracing",
|
||||||
|
"typemap_rev 0.3.0",
|
||||||
|
"typesize",
|
||||||
"url",
|
"url",
|
||||||
"uwl",
|
"uwl",
|
||||||
]
|
]
|
||||||
|
@ -1988,6 +2174,21 @@ dependencies = [
|
||||||
"rand_core",
|
"rand_core",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "skeptic"
|
||||||
|
version = "0.13.7"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "16d23b015676c90a0f01c197bfdc786c20342c73a0afdda9025adb0bc42940a8"
|
||||||
|
dependencies = [
|
||||||
|
"bytecount",
|
||||||
|
"cargo_metadata",
|
||||||
|
"error-chain",
|
||||||
|
"glob",
|
||||||
|
"pulldown-cmark",
|
||||||
|
"tempfile",
|
||||||
|
"walkdir",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "slab"
|
name = "slab"
|
||||||
version = "0.4.9"
|
version = "0.4.9"
|
||||||
|
@ -2332,6 +2533,12 @@ dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tagptr"
|
||||||
|
version = "0.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tempfile"
|
name = "tempfile"
|
||||||
version = "3.10.0"
|
version = "3.10.0"
|
||||||
|
@ -2489,6 +2696,21 @@ dependencies = [
|
||||||
"tokio",
|
"tokio",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tokio-tungstenite"
|
||||||
|
version = "0.20.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c"
|
||||||
|
dependencies = [
|
||||||
|
"futures-util",
|
||||||
|
"log",
|
||||||
|
"rustls 0.21.10",
|
||||||
|
"tokio",
|
||||||
|
"tokio-rustls 0.24.1",
|
||||||
|
"tungstenite 0.20.1",
|
||||||
|
"webpki-roots 0.25.4",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tokio-util"
|
name = "tokio-util"
|
||||||
version = "0.7.10"
|
version = "0.7.10"
|
||||||
|
@ -2541,6 +2763,12 @@ dependencies = [
|
||||||
"once_cell",
|
"once_cell",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "triomphe"
|
||||||
|
version = "0.1.11"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "859eb650cfee7434994602c3a68b25d77ad9e68c8a6cd491616ef86661382eb3"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "try-lock"
|
name = "try-lock"
|
||||||
version = "0.2.5"
|
version = "0.2.5"
|
||||||
|
@ -2568,18 +2796,73 @@ dependencies = [
|
||||||
"webpki",
|
"webpki",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tungstenite"
|
||||||
|
version = "0.20.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9"
|
||||||
|
dependencies = [
|
||||||
|
"byteorder",
|
||||||
|
"bytes",
|
||||||
|
"data-encoding",
|
||||||
|
"http",
|
||||||
|
"httparse",
|
||||||
|
"log",
|
||||||
|
"rand",
|
||||||
|
"rustls 0.21.10",
|
||||||
|
"sha1",
|
||||||
|
"thiserror",
|
||||||
|
"url",
|
||||||
|
"utf-8",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "typemap_rev"
|
name = "typemap_rev"
|
||||||
version = "0.1.5"
|
version = "0.1.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ed5b74f0a24b5454580a79abb6994393b09adf0ab8070f15827cb666255de155"
|
checksum = "ed5b74f0a24b5454580a79abb6994393b09adf0ab8070f15827cb666255de155"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "typemap_rev"
|
||||||
|
version = "0.3.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "74b08b0c1257381af16a5c3605254d529d3e7e109f3c62befc5d168968192998"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "typenum"
|
name = "typenum"
|
||||||
version = "1.17.0"
|
version = "1.17.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825"
|
checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "typesize"
|
||||||
|
version = "0.1.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "36924509726e38224322c8c90ddfbf4317324338327b7c11b7cf8672cb786da1"
|
||||||
|
dependencies = [
|
||||||
|
"chrono",
|
||||||
|
"dashmap",
|
||||||
|
"hashbrown 0.14.3",
|
||||||
|
"mini-moka",
|
||||||
|
"parking_lot",
|
||||||
|
"secrecy",
|
||||||
|
"serde_json",
|
||||||
|
"time",
|
||||||
|
"typesize-derive",
|
||||||
|
"url",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "typesize-derive"
|
||||||
|
version = "0.1.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0b122284365ba8497be951b9a21491f70c9688eb6fddc582931a0703f6a00ece"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn 2.0.48",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicase"
|
name = "unicase"
|
||||||
version = "2.7.0"
|
version = "2.7.0"
|
||||||
|
@ -2676,6 +2959,16 @@ version = "0.9.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
|
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "walkdir"
|
||||||
|
version = "2.4.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee"
|
||||||
|
dependencies = [
|
||||||
|
"same-file",
|
||||||
|
"winapi-util",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "want"
|
name = "want"
|
||||||
version = "0.3.1"
|
version = "0.3.1"
|
||||||
|
@ -3008,7 +3301,7 @@ version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"dotenv",
|
"dotenv",
|
||||||
"env_logger",
|
"env_logger",
|
||||||
"serenity",
|
"serenity 0.12.0",
|
||||||
"tokio",
|
"tokio",
|
||||||
"youmubot-cf",
|
"youmubot-cf",
|
||||||
"youmubot-core",
|
"youmubot-core",
|
||||||
|
@ -3030,7 +3323,7 @@ dependencies = [
|
||||||
"regex",
|
"regex",
|
||||||
"reqwest",
|
"reqwest",
|
||||||
"serde",
|
"serde",
|
||||||
"serenity",
|
"serenity 0.12.0",
|
||||||
"tokio",
|
"tokio",
|
||||||
"youmubot-db",
|
"youmubot-db",
|
||||||
"youmubot-prelude",
|
"youmubot-prelude",
|
||||||
|
@ -3046,7 +3339,7 @@ dependencies = [
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"rand",
|
"rand",
|
||||||
"serde",
|
"serde",
|
||||||
"serenity",
|
"serenity 0.11.7",
|
||||||
"static_assertions",
|
"static_assertions",
|
||||||
"tokio",
|
"tokio",
|
||||||
"youmubot-db",
|
"youmubot-db",
|
||||||
|
@ -3061,7 +3354,7 @@ dependencies = [
|
||||||
"dotenv",
|
"dotenv",
|
||||||
"rustbreak",
|
"rustbreak",
|
||||||
"serde",
|
"serde",
|
||||||
"serenity",
|
"serenity 0.12.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -3092,7 +3385,7 @@ dependencies = [
|
||||||
"rosu-v2",
|
"rosu-v2",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"serenity",
|
"serenity 0.12.0",
|
||||||
"time",
|
"time",
|
||||||
"youmubot-db",
|
"youmubot-db",
|
||||||
"youmubot-db-sql",
|
"youmubot-db-sql",
|
||||||
|
@ -3111,7 +3404,7 @@ dependencies = [
|
||||||
"flume 0.10.14",
|
"flume 0.10.14",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"reqwest",
|
"reqwest",
|
||||||
"serenity",
|
"serenity 0.12.0",
|
||||||
"tokio",
|
"tokio",
|
||||||
"youmubot-db",
|
"youmubot-db",
|
||||||
"youmubot-db-sql",
|
"youmubot-db-sql",
|
||||||
|
|
|
@ -9,7 +9,7 @@ edition = "2021"
|
||||||
serde = { version = "1.0.137", features = ["derive"] }
|
serde = { version = "1.0.137", features = ["derive"] }
|
||||||
tokio = { version = "1.19.2", features = ["time"] }
|
tokio = { version = "1.19.2", features = ["time"] }
|
||||||
reqwest = "0.11.10"
|
reqwest = "0.11.10"
|
||||||
serenity = "0.11.2"
|
serenity = "0.12"
|
||||||
Inflector = "0.11.4"
|
Inflector = "0.11.4"
|
||||||
codeforces = "0.3.1"
|
codeforces = "0.3.1"
|
||||||
regex = "1.5.6"
|
regex = "1.5.6"
|
||||||
|
|
|
@ -7,7 +7,7 @@ edition = "2021"
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
serenity = "0.11.2"
|
serenity = "0.12"
|
||||||
dotenv = "0.15.0"
|
dotenv = "0.15.0"
|
||||||
serde = { version = "1.0.137", features = ["derive"] }
|
serde = { version = "1.0.137", features = ["derive"] }
|
||||||
chrono = "0.4.19"
|
chrono = "0.4.19"
|
||||||
|
|
|
@ -19,7 +19,7 @@ rosu-pp = "0.9.1"
|
||||||
rosu-v2 = { git = "https://github.com/natsukagami/rosu-v2", rev = "6f6731cb2f0d235b006ab375dd94b446dde894ac" }
|
rosu-v2 = { git = "https://github.com/natsukagami/rosu-v2", rev = "6f6731cb2f0d235b006ab375dd94b446dde894ac" }
|
||||||
time = "0.3"
|
time = "0.3"
|
||||||
serde = { version = "1.0.137", features = ["derive"] }
|
serde = { version = "1.0.137", features = ["derive"] }
|
||||||
serenity = "0.11.2"
|
serenity = "0.12"
|
||||||
zip = "0.6.2"
|
zip = "0.6.2"
|
||||||
rand = "0.8"
|
rand = "0.8"
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,6 @@ flume = "0.10.13"
|
||||||
dashmap = "5.3.4"
|
dashmap = "5.3.4"
|
||||||
|
|
||||||
[dependencies.serenity]
|
[dependencies.serenity]
|
||||||
version = "0.11.2"
|
version = "0.12"
|
||||||
default-features = true
|
default-features = true
|
||||||
features = ["collector"]
|
features = ["collector"]
|
||||||
|
|
|
@ -5,22 +5,40 @@ use futures_util::{
|
||||||
stream::{FuturesUnordered, StreamExt},
|
stream::{FuturesUnordered, StreamExt},
|
||||||
};
|
};
|
||||||
use serenity::{
|
use serenity::{
|
||||||
|
client::Cache,
|
||||||
framework::standard::{
|
framework::standard::{
|
||||||
macros::{command, group},
|
macros::{command, group},
|
||||||
Args, CommandResult,
|
Args, CommandResult,
|
||||||
},
|
},
|
||||||
http::CacheHttp,
|
http::{CacheHttp, Http},
|
||||||
model::{
|
model::{
|
||||||
channel::Message,
|
channel::Message,
|
||||||
id::{ChannelId, GuildId, UserId},
|
id::{ChannelId, GuildId, UserId},
|
||||||
},
|
},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
utils::MessageBuilder,
|
utils::MessageBuilder,
|
||||||
CacheAndHttp,
|
|
||||||
};
|
};
|
||||||
use std::{collections::HashMap, sync::Arc};
|
use std::{collections::HashMap, sync::Arc};
|
||||||
use youmubot_db::DB;
|
use youmubot_db::DB;
|
||||||
|
|
||||||
|
#[derive(Debug, Clone)]
|
||||||
|
pub struct CacheAndHttp(Arc<Cache>, Arc<Http>);
|
||||||
|
|
||||||
|
impl CacheAndHttp {
|
||||||
|
pub fn from_client(client: &Client) -> Self {
|
||||||
|
Self(client.cache.clone(), client.http.clone())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl CacheHttp for CacheAndHttp {
|
||||||
|
fn cache(&self) -> Option<&Arc<Cache>> {
|
||||||
|
Some(&self.0)
|
||||||
|
}
|
||||||
|
fn http(&self) -> &Http {
|
||||||
|
&*self.1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// A list of assigned channels for an announcer.
|
/// A list of assigned channels for an announcer.
|
||||||
pub(crate) type AnnouncerChannels = DB<HashMap<String, HashMap<GuildId, ChannelId>>>;
|
pub(crate) type AnnouncerChannels = DB<HashMap<String, HashMap<GuildId, ChannelId>>>;
|
||||||
|
|
||||||
|
@ -39,7 +57,7 @@ pub trait Announcer: Send {
|
||||||
/// Errors returned from this function gets ignored and logged down.
|
/// Errors returned from this function gets ignored and logged down.
|
||||||
async fn updates(
|
async fn updates(
|
||||||
&mut self,
|
&mut self,
|
||||||
c: Arc<CacheAndHttp>,
|
c: CacheAndHttp,
|
||||||
d: AppData,
|
d: AppData,
|
||||||
channels: MemberToChannels,
|
channels: MemberToChannels,
|
||||||
) -> Result<()>;
|
) -> Result<()>;
|
||||||
|
@ -76,7 +94,7 @@ impl MemberToChannels {
|
||||||
///
|
///
|
||||||
/// This struct manages the list of all Announcers, firing them in a certain interval.
|
/// This struct manages the list of all Announcers, firing them in a certain interval.
|
||||||
pub struct AnnouncerHandler {
|
pub struct AnnouncerHandler {
|
||||||
cache_http: Arc<CacheAndHttp>,
|
cache_http: CacheAndHttp,
|
||||||
data: AppData,
|
data: AppData,
|
||||||
announcers: HashMap<&'static str, RwLock<Box<dyn Announcer + Send + Sync>>>,
|
announcers: HashMap<&'static str, RwLock<Box<dyn Announcer + Send + Sync>>>,
|
||||||
}
|
}
|
||||||
|
@ -91,7 +109,7 @@ impl AnnouncerHandler {
|
||||||
/// Create a new instance of the handler.
|
/// Create a new instance of the handler.
|
||||||
pub fn new(client: &serenity::Client) -> Self {
|
pub fn new(client: &serenity::Client) -> Self {
|
||||||
Self {
|
Self {
|
||||||
cache_http: client.cache_and_http.clone(),
|
cache_http: CacheAndHttp(client.cache.clone(), client.http.clone()),
|
||||||
data: client.data.clone(),
|
data: client.data.clone(),
|
||||||
announcers: HashMap::new(),
|
announcers: HashMap::new(),
|
||||||
}
|
}
|
||||||
|
@ -135,7 +153,7 @@ impl AnnouncerHandler {
|
||||||
/// Run the announcing sequence on a certain announcer.
|
/// Run the announcing sequence on a certain announcer.
|
||||||
async fn announce(
|
async fn announce(
|
||||||
data: AppData,
|
data: AppData,
|
||||||
cache_http: Arc<CacheAndHttp>,
|
cache_http: CacheAndHttp,
|
||||||
key: &'static str,
|
key: &'static str,
|
||||||
announcer: &'_ RwLock<Box<dyn Announcer + Send + Sync>>,
|
announcer: &'_ RwLock<Box<dyn Announcer + Send + Sync>>,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
|
@ -243,7 +261,11 @@ pub async fn register_announcer(ctx: &Context, m: &Message, mut args: Args) -> C
|
||||||
.await?;
|
.await?;
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
let guild = m.guild(ctx).expect("Guild-only command");
|
let guild = m
|
||||||
|
.guild_id
|
||||||
|
.expect("Guild-only command")
|
||||||
|
.to_partial_guild(&ctx)
|
||||||
|
.await?;
|
||||||
let channel = m.channel_id.to_channel(&ctx).await?;
|
let channel = m.channel_id.to_channel(&ctx).await?;
|
||||||
AnnouncerChannels::open(&data)
|
AnnouncerChannels::open(&data)
|
||||||
.borrow_mut()?
|
.borrow_mut()?
|
||||||
|
@ -258,7 +280,7 @@ pub async fn register_announcer(ctx: &Context, m: &Message, mut args: Args) -> C
|
||||||
.push(" has been activated for server ")
|
.push(" has been activated for server ")
|
||||||
.push_bold_safe(&guild.name)
|
.push_bold_safe(&guild.name)
|
||||||
.push(" on channel ")
|
.push(" on channel ")
|
||||||
.push_bold_safe(channel)
|
.push_bold_safe(channel.mention().to_string())
|
||||||
.build(),
|
.build(),
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
@ -286,7 +308,11 @@ pub async fn remove_announcer(ctx: &Context, m: &Message, mut args: Args) -> Com
|
||||||
.await?;
|
.await?;
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
let guild = m.guild(ctx).expect("Guild-only command");
|
let guild = m
|
||||||
|
.guild_id
|
||||||
|
.expect("Guild-only command")
|
||||||
|
.to_partial_guild(&ctx)
|
||||||
|
.await?;
|
||||||
AnnouncerChannels::open(&data)
|
AnnouncerChannels::open(&data)
|
||||||
.borrow_mut()?
|
.borrow_mut()?
|
||||||
.entry(key.clone())
|
.entry(key.clone())
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
use crate::{Context, Result};
|
use crate::{Context, Result};
|
||||||
use futures_util::{future::Future, StreamExt};
|
use futures_util::{future::Future, StreamExt as _};
|
||||||
use serenity::{
|
use serenity::{
|
||||||
collector::ReactionAction,
|
builder::CreateMessage,
|
||||||
|
collector,
|
||||||
model::{
|
model::{
|
||||||
channel::{Message, Reaction, ReactionType},
|
channel::{Message, Reaction, ReactionType},
|
||||||
id::ChannelId,
|
id::ChannelId,
|
||||||
|
@ -35,7 +36,7 @@ pub trait Paginate: Send + Sized {
|
||||||
page: u8,
|
page: u8,
|
||||||
ctx: &Context,
|
ctx: &Context,
|
||||||
message: &mut Message,
|
message: &mut Message,
|
||||||
reaction: &ReactionAction,
|
reaction: &Reaction,
|
||||||
) -> Result<Option<u8>> {
|
) -> Result<Option<u8>> {
|
||||||
handle_pagination_reaction(page, self, ctx, message, reaction)
|
handle_pagination_reaction(page, self, ctx, message, reaction)
|
||||||
.await
|
.await
|
||||||
|
@ -91,7 +92,10 @@ pub async fn paginate(
|
||||||
timeout: std::time::Duration,
|
timeout: std::time::Duration,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
let message = channel
|
let message = channel
|
||||||
.send_message(&ctx, |e| e.content("Youmu is loading the first page..."))
|
.send_message(
|
||||||
|
&ctx,
|
||||||
|
CreateMessage::new().content("Youmu is loading the first page..."),
|
||||||
|
)
|
||||||
.await?;
|
.await?;
|
||||||
paginate_with_first_message(pager, ctx, message, timeout).await
|
paginate_with_first_message(pager, ctx, message, timeout).await
|
||||||
}
|
}
|
||||||
|
@ -137,7 +141,18 @@ async fn paginate_with_first_message(
|
||||||
rs
|
rs
|
||||||
};
|
};
|
||||||
// Build a reaction collector
|
// Build a reaction collector
|
||||||
let mut reaction_collector = message.await_reactions(ctx).removed(true).build();
|
let mut reaction_collector = {
|
||||||
|
// message.await_reactions(ctx).removed(true).build();
|
||||||
|
let message_id = message.id;
|
||||||
|
collector::collect(&ctx.shard, move |event| {
|
||||||
|
match event {
|
||||||
|
serenity::all::Event::ReactionAdd(r) => Some(r.reaction.clone()),
|
||||||
|
serenity::all::Event::ReactionRemove(r) => Some(r.reaction.clone()),
|
||||||
|
_ => None,
|
||||||
|
}
|
||||||
|
.filter(|r| r.message_id == message_id)
|
||||||
|
})
|
||||||
|
};
|
||||||
let mut page = 0;
|
let mut page = 0;
|
||||||
|
|
||||||
// Loop the handler function.
|
// Loop the handler function.
|
||||||
|
@ -201,11 +216,8 @@ pub async fn handle_pagination_reaction(
|
||||||
pager: &mut impl Paginate,
|
pager: &mut impl Paginate,
|
||||||
ctx: &Context,
|
ctx: &Context,
|
||||||
message: &mut Message,
|
message: &mut Message,
|
||||||
reaction: &ReactionAction,
|
reaction: &Reaction,
|
||||||
) -> Result<u8> {
|
) -> Result<u8> {
|
||||||
let reaction = match reaction {
|
|
||||||
ReactionAction::Added(v) | ReactionAction::Removed(v) => v,
|
|
||||||
};
|
|
||||||
let pages = pager.len();
|
let pages = pager.len();
|
||||||
let fast = pages.map(|v| v / 10).unwrap_or(5).max(5) as u8;
|
let fast = pages.map(|v| v / 10).unwrap_or(5).max(5) as u8;
|
||||||
match &reaction.emoji {
|
match &reaction.emoji {
|
||||||
|
|
|
@ -12,7 +12,7 @@ osu = ["youmubot-osu"]
|
||||||
codeforces = ["youmubot-cf"]
|
codeforces = ["youmubot-cf"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
serenity = "0.11.2"
|
serenity = "0.12"
|
||||||
tokio = { version = "1.19.2", features = ["rt-multi-thread"] }
|
tokio = { version = "1.19.2", features = ["rt-multi-thread"] }
|
||||||
dotenv = "0.15.0"
|
dotenv = "0.15.0"
|
||||||
env_logger = "0.9.0"
|
env_logger = "0.9.0"
|
||||||
|
|
Loading…
Add table
Reference in a new issue