diff --git a/Cargo.lock b/Cargo.lock index 702ac53..ad59cf8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,5 +1,7 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 3 + [[package]] name = "adler" version = "1.0.2" @@ -8,11 +10,12 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aead" -version = "0.3.2" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" +checksum = "6e3e798aa0c8239776f54415bc06f3d74b1850f3f830b45c35cfc80556973f70" dependencies = [ "generic-array", + "rand_core", ] [[package]] @@ -21,7 +24,7 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43bb833f0bf979d8475d38fbf09ed3b8a55e1885fe93ad3f93239fc6a4f17b98" dependencies = [ - "getrandom 0.2.3", + "getrandom", "once_cell", "version_check", ] @@ -35,6 +38,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "arrayvec" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" +dependencies = [ + "nodrop", +] + [[package]] name = "arrayvec" version = "0.5.2" @@ -43,31 +55,15 @@ checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[package]] name = "async-trait" -version = "0.1.50" +version = "0.1.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b98e84bbb4cbcdd97da190ba0c58a1bb0de2c1fdf67d159e192ed766aeca722" +checksum = "44318e776df68115a881de9a8fd1b9e53368d7a4a5ce4cc48517da3393233a5e" dependencies = [ "proc-macro2", "quote", "syn", ] -[[package]] -name = "async-tungstenite" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7cc5408453d37e2b1c6f01d8078af1da58b6cfa6a80fa2ede3bd2b9a6ada9c4" -dependencies = [ - "futures-io", - "futures-util", - "log 0.4.14", - "pin-project", - "tokio", - "tokio-rustls", - "tungstenite 0.11.1", - "webpki-roots 0.20.0", -] - [[package]] name = "async-tungstenite" version = "0.13.1" @@ -76,12 +72,12 @@ checksum = "07b30ef0ea5c20caaa54baea49514a206308989c68be7ecd86c7f956e4da6378" dependencies = [ "futures-io", "futures-util", - "log 0.4.14", + "log", "pin-project-lite", "tokio", "tokio-rustls", - "tungstenite 0.13.0", - "webpki-roots 0.21.1", + "tungstenite", + "webpki-roots", ] [[package]] @@ -101,7 +97,7 @@ checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ "hermit-abi", "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -119,7 +115,7 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "927791de46f70facea982dbfaf19719a41ce6064443403be631a85de6a58fff9" dependencies = [ - "log 0.4.14", + "log", "pkg-config", ] @@ -135,12 +131,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" -[[package]] -name = "base64" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" - [[package]] name = "base64" version = "0.13.0" @@ -160,15 +150,9 @@ dependencies = [ [[package]] name = "bitflags" -version = "0.5.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f67931368edf3a9a51d29886d245f1c3db2f1ef0dcc9e35ff70341b78c10d23" - -[[package]] -name = "bitflags" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "2da1976d75adbe5fbc88130ecd119529cf1cc6a93ae1546d8696ee66f0d21af1" [[package]] name = "bitvec" @@ -203,12 +187,6 @@ version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" -[[package]] -name = "bytes" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" - [[package]] name = "bytes" version = "1.0.1" @@ -217,9 +195,9 @@ checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040" [[package]] name = "cc" -version = "1.0.68" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a72c244c1ff497a746a7e1fb3d14bd08420ecda70c8f25c7112f2781652d787" +checksum = "e70cc2f62c6ce1868963827bd677764c62d07c3d9a3e1fb1177ee1a9ab199eb2" [[package]] name = "cfg-if" @@ -244,14 +222,14 @@ dependencies = [ "num-traits 0.2.14", "serde", "time", - "winapi 0.3.9", + "winapi", ] [[package]] name = "cipher" -version = "0.2.5" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" +checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" dependencies = [ "generic-array", ] @@ -259,6 +237,7 @@ dependencies = [ [[package]] name = "command_attr" version = "0.3.7" +source = "git+https://github.com/serenity-rs/serenity?branch=next#4d431726f4eb2f29a040b83fb4a18a459427c1b2" dependencies = [ "proc-macro2", "quote", @@ -290,12 +269,6 @@ dependencies = [ "libc", ] -[[package]] -name = "cpuid-bool" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcb25d077389e53838a8158c8e99174c5a9d902dee4904320db714f3c653ffba" - [[package]] name = "crc32fast" version = "1.2.1" @@ -353,6 +326,7 @@ checksum = "e77a43b28d0668df09411cb0bc9a8c2adc40f9a048afe863e05fd43251e8e39c" dependencies = [ "cfg-if 1.0.0", "num_cpus", + "serde", ] [[package]] @@ -366,14 +340,12 @@ dependencies = [ [[package]] name = "discortp" -version = "0.2.2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c0d482488c336a2164529765da3f645f26215df9c2033137ddedac333c8e2e8" +checksum = "fb66017646a48220b5ea30d63ac18bb5952f647f1a41ed755880895125d26972" dependencies = [ - "glob", "pnet_macros", "pnet_macros_support", - "syntex", ] [[package]] @@ -414,7 +386,7 @@ checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3" dependencies = [ "atty", "humantime", - "log 0.4.14", + "log", "regex", "termcolor", ] @@ -433,9 +405,9 @@ dependencies = [ [[package]] name = "flume" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddad16e8529759736a9ce4cdf078ed702e45d3c5b0474a1c65f5149e9fa7f1eb" +checksum = "2e90cc80fad5bb391b38127896b0fa27d97e7fef74742797f4da518d67e1292f" dependencies = [ "futures-core", "futures-sink", @@ -483,9 +455,9 @@ checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7" [[package]] name = "futures" -version = "0.3.15" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7e43a803dae2fa37c1f6a8fe121e1f7bf9548b4dfc0522a42f34145dadfc27" +checksum = "1adc00f486adfc9ce99f77d717836f0c5aa84965eb0b4f051f4e83f7cab53f8b" dependencies = [ "futures-channel", "futures-core", @@ -498,9 +470,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.15" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e682a68b29a882df0545c143dc3646daefe80ba479bcdede94d5a703de2871e2" +checksum = "74ed2411805f6e4e3d9bc904c95d5d423b89b3b25dc0250aa74729de20629ff9" dependencies = [ "futures-core", "futures-sink", @@ -508,15 +480,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.15" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0402f765d8a89a26043b889b26ce3c4679d268fa6bb22cd7c6aad98340e179d1" +checksum = "af51b1b4a7fdff033703db39de8802c673eb91855f2e0d47dcf3bf2c0ef01f99" [[package]] name = "futures-executor" -version = "0.3.15" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "badaa6a909fac9e7236d0620a2f57f7664640c56575b71a7552fbd68deafab79" +checksum = "4d0d535a57b87e1ae31437b892713aee90cd2d7b0ee48727cd11fc72ef54761c" dependencies = [ "futures-core", "futures-task", @@ -525,15 +497,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.15" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acc499defb3b348f8d8f3f66415835a9131856ff7714bf10dadfc4ec4bdb29a1" +checksum = "0b0e06c393068f3a6ef246c75cdca793d6a46347e75286933e5e75fd2fd11582" [[package]] name = "futures-macro" -version = "0.3.15" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c40298486cdf52cc00cd6d6987892ba502c7656a16a4192a9992b1ccedd121" +checksum = "c54913bae956fb8df7f4dc6fc90362aa72e69148e3f39041fbe8742d21e0ac57" dependencies = [ "autocfg 1.0.1", "proc-macro-hack", @@ -544,21 +516,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.15" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a57bead0ceff0d6dde8f465ecd96c9338121bb7717d3e7b108059531870c4282" +checksum = "c0f30aaa67363d119812743aa5f33c201a7a66329f97d1a887022971feea4b53" [[package]] name = "futures-task" -version = "0.3.15" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a16bef9fc1a4dddb5bee51c989e3fbba26569cbb0e31f5b303c184e3dd33dae" +checksum = "bbe54a98670017f3be909561f6ad13e810d9a51f3f061b902062ca3da80799f2" [[package]] name = "futures-util" -version = "0.3.15" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "feb5c238d27e2bf94ffdfd27b2c29e3df4a68c4193bb6427384259e2bf191967" +checksum = "67eb846bfd58e44a8481a00049e82c43e0ccb5d61f8dc071057cb19249dd4d78" dependencies = [ "autocfg 1.0.1", "futures-channel", @@ -583,9 +555,9 @@ checksum = "061d3be1afec479d56fa3bd182bf966c7999ec175fcfdb87ac14d417241366c6" dependencies = [ "cc", "libc", - "log 0.4.14", + "log", "rustversion", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -598,17 +570,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "getrandom" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "wasi 0.9.0+wasi-snapshot-preview1", -] - [[package]] name = "getrandom" version = "0.2.3" @@ -618,23 +579,17 @@ dependencies = [ "cfg-if 1.0.0", "js-sys", "libc", - "wasi 0.10.2+wasi-snapshot-preview1", + "wasi", "wasm-bindgen", ] -[[package]] -name = "glob" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" - [[package]] name = "h2" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "825343c4eef0b63f541f8903f395dc5beb362a979b5799a84062527ef1e37726" dependencies = [ - "bytes 1.0.1", + "bytes", "fnv", "futures-core", "futures-sink", @@ -647,12 +602,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "hashbrown" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" - [[package]] name = "hashbrown" version = "0.11.2" @@ -668,7 +617,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7249a3129cbc1ffccd74857f81464a323a152173cdb134e0fd81bc803b29facf" dependencies = [ - "hashbrown 0.11.2", + "hashbrown", ] [[package]] @@ -682,9 +631,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" dependencies = [ "libc", ] @@ -701,18 +650,18 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "527e8c9ac747e28542699a951517aa9a6945af506cd1f2e1b53a576c17b6cc11" dependencies = [ - "bytes 1.0.1", + "bytes", "fnv", "itoa", ] [[package]] name = "http-body" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60daa14be0e0786db0f03a9e57cb404c9d756eed2b6c62b9ea98ec5743ec75a9" +checksum = "399c583b2979440c60be0821a6199eca73bc3c8dcd9d070d75ac726e2c6186e5" dependencies = [ - "bytes 1.0.1", + "bytes", "http", "pin-project-lite", ] @@ -737,11 +686,11 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.9" +version = "0.14.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07d6baa1b441335f3ce5098ac421fb6547c46dda735ca1bc6d0153c838f9dd83" +checksum = "0b61cf2d1aebcf6e6352c97b81dc2244ca29194be1b276f5d8ad5c6330fffb11" dependencies = [ - "bytes 1.0.1", + "bytes", "futures-channel", "futures-core", "futures-util", @@ -767,7 +716,7 @@ checksum = "5f9f7a97316d44c0af9b0301e65010573a853a9fc97046d7331d7f6bc0fd5a64" dependencies = [ "futures-util", "hyper", - "log 0.4.14", + "log", "rustls", "tokio", "tokio-rustls", @@ -780,7 +729,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ - "bytes 1.0.1", + "bytes", "hyper", "native-tls", "tokio", @@ -800,21 +749,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.6.2" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824845a0bf897a9042383849b02c1bc219c2383772efcd5c6f9766fa4b81aef3" +checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" dependencies = [ "autocfg 1.0.1", - "hashbrown 0.9.1", -] - -[[package]] -name = "input_buffer" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19a8a95243d5a0398cae618ec29477c6e3cb631152be5c19481f80bc71559754" -dependencies = [ - "bytes 0.5.6", + "hashbrown", ] [[package]] @@ -823,14 +763,14 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f97967975f448f1a7ddb12b0bc41069d09ed6a1c161a92687e057325db35d413" dependencies = [ - "bytes 1.0.1", + "bytes", ] [[package]] name = "instant" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec" +checksum = "bee0328b1209d157ef001c94dd85b4f8f64139adb0eac2659f4b08382b2f474d" dependencies = [ "cfg-if 1.0.0", ] @@ -849,23 +789,13 @@ checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" [[package]] name = "js-sys" -version = "0.3.51" +version = "0.3.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83bdfbace3a0e81a4253f73b49e960b053e396a11012cbd49b9b74d6a2b67062" +checksum = "ce791b7ca6638aae45be056e068fc756d871eb3b3b10b8efa62d1c9cec616752" dependencies = [ "wasm-bindgen", ] -[[package]] -name = "kernel32-sys" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - [[package]] name = "lazy_static" version = "1.4.0" @@ -881,8 +811,8 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe" dependencies = [ - "arrayvec", - "bitflags 1.2.1", + "arrayvec 0.5.2", + "bitflags", "cfg-if 1.0.0", "ryu", "static_assertions", @@ -890,9 +820,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.97" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12b8adadd720df158f4d70dfe7ccc6adb0472d7c55ca83445f6a5ab3e36f8fb6" +checksum = "a7f823d141fe0a24df1e23b4af4e3c7ba9e5966ec514ea068c93024aa7deb765" [[package]] name = "libm" @@ -909,15 +839,6 @@ dependencies = [ "scopeguard", ] -[[package]] -name = "log" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" -dependencies = [ - "log 0.4.14", -] - [[package]] name = "log" version = "0.4.14" @@ -948,9 +869,9 @@ checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" [[package]] name = "matches" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" +checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" [[package]] name = "memchr" @@ -991,10 +912,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c2bdb6314ec10835cd3293dd268473a835c02b7b352e788be788b3c6ca6bb16" dependencies = [ "libc", - "log 0.4.14", + "log", "miow", "ntapi", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1003,27 +924,27 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] name = "nanorand" -version = "0.5.2" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1378b66f7c93a1c0f8464a19bf47df8795083842e5090f4b7305973d5a22d0" +checksum = "729eb334247daa1803e0a094d0a5c55711b85571179f5ec6e53eccfdf7008958" dependencies = [ - "getrandom 0.2.3", + "getrandom", ] [[package]] name = "native-tls" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8d96b2e1c8da3957d58100b09f102c6d9cfdfced01b7ec5a8974044bb09dbd4" +checksum = "48ba9f7719b5a0f42f338907614285fb5fd70e53858141f69898a1fb7203b24d" dependencies = [ "lazy_static", "libc", - "log 0.4.14", + "log", "openssl", "openssl-probe", "openssl-sys", @@ -1033,6 +954,12 @@ dependencies = [ "tempfile", ] +[[package]] +name = "nodrop" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" + [[package]] name = "nom" version = "6.1.2" @@ -1052,7 +979,7 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1090,7 +1017,7 @@ dependencies = [ "num-integer", "num-iter", "num-traits 0.2.14", - "rand 0.8.4", + "rand", "smallvec", "zeroize", ] @@ -1163,7 +1090,7 @@ version = "0.10.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "549430950c79ae24e6d02e0b7404534ecf311d94cc9f861e9e4020187d13d885" dependencies = [ - "bitflags 1.2.1", + "bitflags", "cfg-if 1.0.0", "foreign-types", "libc", @@ -1212,7 +1139,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1221,7 +1148,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd56cbd21fea48d0c440b41cd69c589faacade08c992d9a54e471b79d0fd13eb" dependencies = [ - "base64 0.13.0", + "base64", "once_cell", "regex", ] @@ -1234,18 +1161,18 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] name = "pin-project" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7509cc106041c40a4518d2af7a61530e1eed0e6285296a3d8c5472806ccc4a4" +checksum = "576bc800220cc65dac09e99e97b08b358cfab6e17078de8dc5fee223bd2d0c08" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c950132583b500556b1efd71d45b319029f2b71518d979fcc208e16b42426f" +checksum = "6e8fe8163d14ce7f0cdac2e040116f22eac817edabff0be91e8aff7e9accf389" dependencies = [ "proc-macro2", "quote", @@ -1254,9 +1181,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc0e1f259c92177c30a4c9d177246edd0a3568b25756a977d0632cf8fa37e905" +checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" [[package]] name = "pin-utils" @@ -1272,37 +1199,39 @@ checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" [[package]] name = "pnet_base" -version = "0.26.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7cd5f7e15220afa66b0a9a62841ea10089f39dcaa1c29752c0b22dfc03111b5" +checksum = "25488cd551a753dcaaa6fffc9f69a7610a412dd8954425bf7ffad5f7d1156fb8" [[package]] name = "pnet_macros" -version = "0.26.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbbd5c52c6e04aa720400f9c71cd0e8bcb38cd13421d5caabd9035e9efa47de9" +checksum = "30490e0852e58402b8fae0d39897b08a24f493023a4d6cf56b2e30f31ed57548" dependencies = [ + "proc-macro2", + "quote", "regex", - "syntex", - "syntex_syntax", + "syn", ] [[package]] name = "pnet_macros_support" -version = "0.26.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daf9c5c0c36766d0a4da9ab268c0700771b8ec367b9463fd678109fa28463c5b" +checksum = "d4714e10f30cab023005adce048f2d30dd4ac4f093662abf2220855655ef8f90" dependencies = [ "pnet_base", ] [[package]] name = "poly1305" -version = "0.6.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b7456bc1ad2d4cf82b3a016be4c2ac48daf11bf990c1603ebd447fe6f30fca8" +checksum = "9fcffab1f78ebbdf4b93b68c1ffebc24037eedf271edaca795732b24e5e4e349" dependencies = [ - "cpuid-bool", + "cpufeatures", + "opaque-debug", "universal-hash", ] @@ -1326,11 +1255,11 @@ checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" [[package]] name = "proc-macro2" -version = "1.0.27" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" +checksum = "5c7ed8b8c7b886ea3ed7dde405212185f423ab44682667c8c6dd14aa1d9f6612" dependencies = [ - "unicode-xid 0.2.2", + "unicode-xid", ] [[package]] @@ -1348,19 +1277,6 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "941ba9d78d8e2f7ce474c015eea4d9c6d25b6a3327f9832ee29a4de27f91bbb8" -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom 0.1.16", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc 0.2.0", -] - [[package]] name = "rand" version = "0.8.4" @@ -1368,19 +1284,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" dependencies = [ "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.3", - "rand_hc 0.3.1", -] - -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", + "rand_chacha", + "rand_core", + "rand_hc", ] [[package]] @@ -1390,16 +1296,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.3", -] - -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -dependencies = [ - "getrandom 0.1.16", + "rand_core", ] [[package]] @@ -1408,16 +1305,7 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" dependencies = [ - "getrandom 0.2.3", -] - -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core 0.5.1", + "getrandom", ] [[package]] @@ -1426,16 +1314,16 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" dependencies = [ - "rand_core 0.6.3", + "rand_core", ] [[package]] name = "redox_syscall" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab49abadf3f9e1c4bc499e8845e152ad87d2ad2d30371841171169e9d75feee" +checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" dependencies = [ - "bitflags 1.2.1", + "bitflags", ] [[package]] @@ -1470,7 +1358,7 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1479,8 +1367,8 @@ version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "246e9f61b9bb77df069a947682be06e31ac43ea37862e244a69f177694ea6d22" dependencies = [ - "base64 0.13.0", - "bytes 1.0.1", + "base64", + "bytes", "encoding_rs", "futures-core", "futures-util", @@ -1492,7 +1380,7 @@ dependencies = [ "ipnet", "js-sys", "lazy_static", - "log 0.4.14", + "log", "mime", "mime_guess", "native-tls", @@ -1509,7 +1397,7 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots 0.21.1", + "webpki-roots", "winreg", ] @@ -1525,14 +1413,14 @@ dependencies = [ "spin", "untrusted", "web-sys", - "winapi 0.3.9", + "winapi", ] [[package]] name = "rsa" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68ef841a26fc5d040ced0417c6c6a64ee851f42489df11cdf0218e545b6f8d28" +checksum = "7b0aeddcca1082112a6eeb43bf25fd7820b066aaf6eaef776e19d0a1febe38fe" dependencies = [ "byteorder", "digest", @@ -1542,26 +1430,20 @@ dependencies = [ "num-iter", "num-traits 0.2.14", "pem", - "rand 0.8.4", + "rand", "simple_asn1", "subtle", "zeroize", ] -[[package]] -name = "rustc-serialize" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" - [[package]] name = "rustls" version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" dependencies = [ - "base64 0.13.0", - "log 0.4.14", + "base64", + "log", "ring", "sct", "webpki", @@ -1581,9 +1463,9 @@ checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" [[package]] name = "salsa20" -version = "0.7.2" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "399f290ffc409596022fce5ea5d4138184be4784f2b28c62c59f0d8389059a15" +checksum = "ecbd2eb639fd7cab5804a0837fe373cc2172d15437e804c054a9fb885cb923b0" dependencies = [ "cipher", "zeroize", @@ -1596,7 +1478,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" dependencies = [ "lazy_static", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1627,7 +1509,7 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23a2ac85147a3a11d77ecf1bc7166ec0b92febfa4461c37944e180f319ece467" dependencies = [ - "bitflags 1.2.1", + "bitflags", "core-foundation", "core-foundation-sys", "libc", @@ -1646,18 +1528,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.126" +version = "1.0.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03" +checksum = "f03b9878abf6d14e6779d3f24f07b2cfa90352cfec4acc5aab8f1ac7f146fae8" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.126" +version = "1.0.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43" +checksum = "a024926d3432516606328597e0f224a51355a493b49fdd67e9209187cbe55ecc" dependencies = [ "proc-macro2", "quote", @@ -1666,9 +1548,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.64" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" +checksum = "336b10da19a12ad094b59d870ebde26a45402e5b470add4b5fd03c5048a32127" dependencies = [ "itoa", "ryu", @@ -1701,16 +1583,21 @@ dependencies = [ [[package]] name = "serenity" version = "0.10.8" +source = "git+https://github.com/serenity-rs/serenity?branch=next#4d431726f4eb2f29a040b83fb4a18a459427c1b2" dependencies = [ "async-trait", - "async-tungstenite 0.11.0", - "base64 0.13.0", - "bitflags 1.2.1", - "bytes 1.0.1", + "async-tungstenite", + "base64", + "bitflags", + "bytes", "chrono", "command_attr", + "dashmap", "flate2", "futures", + "mime", + "mime_guess", + "parking_lot", "percent-encoding", "reqwest", "serde", @@ -1726,10 +1613,9 @@ dependencies = [ [[package]] name = "serenity-voice-model" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "158aeb823791f79bbb92110212970797757fee7102784453dcb9b172a8af272b" +source = "git+https://github.com/serenity-rs/serenity?branch=next#4d431726f4eb2f29a040b83fb4a18a459427c1b2" dependencies = [ - "bitflags 1.2.1", + "bitflags", "enum_primitive", "serde", "serde_json", @@ -1738,9 +1624,9 @@ dependencies = [ [[package]] name = "sha-1" -version = "0.9.6" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c4cfa741c5832d0ef7fab46cabed29c2aae926db0b11bb2069edd8db5e64e16" +checksum = "1a0c8611594e2ab4ebbf06ec7cbbf0a99450b8570e96cbf5188b5d5f6ef18d81" dependencies = [ "block-buffer", "cfg-if 1.0.0", @@ -1773,9 +1659,9 @@ dependencies = [ [[package]] name = "simple_asn1" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc31e6cf34ad4321d3a2b8f934949b429e314519f753a77962f16c664dca8e13" +checksum = "8eb4ea60fb301dc81dfc113df680571045d375ab7345d171c5dc7d7e13107a80" dependencies = [ "chrono", "num-bigint 0.4.0", @@ -1785,9 +1671,9 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f173ac3d1a7e3b28003f40de0b5ce7fe2710f9b9dc3fc38664cebee46b3b6527" +checksum = "c307a32c1c5c437f38c7fd45d753050587732ba8628319fbdf12a7e289ccc590" [[package]] name = "smallvec" @@ -1797,20 +1683,21 @@ checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" [[package]] name = "socket2" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3dfc207c526015c632472a77be09cf1b6e46866581aecae5cc38fb4235dea2" +checksum = "765f090f0e423d2b55843402a07915add955e7d60657db13707a159727326cad" dependencies = [ "libc", - "winapi 0.3.9", + "winapi", ] [[package]] name = "songbird" -version = "0.1.7" +version = "0.2.0-beta.4" +source = "git+https://github.com/serenity-rs/songbird?branch=next#2a2543ebc830ba442bcd836733d52114fd1b3f8a" dependencies = [ "async-trait", - "async-tungstenite 0.13.1", + "async-tungstenite", "audiopus", "byteorder", "dashmap", @@ -1818,14 +1705,15 @@ dependencies = [ "flume", "futures", "parking_lot", - "rand 0.8.4", + "pin-project", + "rand", "serde", "serde_json", "serenity", "serenity-voice-model", "spin_sleep", - "spinning_top", "streamcatcher", + "symphonia-core", "tokio", "tracing", "tracing-futures", @@ -1837,13 +1725,13 @@ dependencies = [ [[package]] name = "soundfx-rs" -version = "1.3.1" +version = "1.4.0" dependencies = [ "dashmap", "dotenv", "env_logger", "lazy_static", - "log 0.4.14", + "log", "regex", "regex_command_attr", "reqwest", @@ -1867,14 +1755,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a98101bdc3833e192713c2af0b0dd2614f50d1cf1f7a97c5221b7aac052acc7" dependencies = [ "once_cell", - "winapi 0.3.9", + "winapi", ] [[package]] name = "spinning_top" -version = "0.2.2" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e529d73e80d64b5f2631f9035113347c578a1c9c7774b83a2b880788459ab36" +checksum = "75adad84ee84b521fb2cca2d4fd0f1dab1d8d026bda3c5bea4ca63b5f9f9293c" dependencies = [ "lock_api", ] @@ -1910,11 +1798,11 @@ checksum = "7f23af36748ec8ea8d49ef8499839907be41b0b1178a4e82b8cb45d29f531dc9" dependencies = [ "ahash", "atoi", - "base64 0.13.0", + "base64", "bigdecimal", - "bitflags 1.2.1", + "bitflags", "byteorder", - "bytes 1.0.1", + "bytes", "crossbeam-channel", "crossbeam-queue", "crossbeam-utils 0.8.5", @@ -1928,13 +1816,13 @@ dependencies = [ "hex", "itoa", "libc", - "log 0.4.14", + "log", "memchr", "num-bigint 0.3.2", "once_cell", "parking_lot", "percent-encoding", - "rand 0.8.4", + "rand", "rsa", "rustls", "sha-1", @@ -1947,7 +1835,7 @@ dependencies = [ "tokio-stream", "url", "webpki", - "webpki-roots 0.21.1", + "webpki-roots", "whoami", ] @@ -2010,80 +1898,44 @@ dependencies = [ [[package]] name = "subtle" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e81da0851ada1f3e9d4312c704aa4f8806f0f9d69faaf8df2f3464b4a9437c2" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "symphonia-core" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e32b956473d98c601dac257fab8a7700d42e49fdd7a33432dd5dc7fdd2448dd" +dependencies = [ + "arrayvec 0.4.12", + "bitflags", + "byteorder", + "lazy_static", + "log", +] [[package]] name = "syn" -version = "1.0.73" +version = "1.0.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f71489ff30030d2ae598524f61326b902466f72a0fb1a8564c001cc63425bcc7" +checksum = "1873d832550d4588c3dbc20f01361ab00bfe741048f71e3fecf145a7cc18b29c" dependencies = [ "proc-macro2", "quote", - "unicode-xid 0.2.2", + "unicode-xid", ] [[package]] name = "synstructure" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701" +checksum = "474aaa926faa1603c40b7885a9eaea29b444d1cb2850cb7c0e37bb1a4182f4fa" dependencies = [ "proc-macro2", "quote", "syn", - "unicode-xid 0.2.2", -] - -[[package]] -name = "syntex" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a30b08a6b383a22e5f6edc127d169670d48f905bb00ca79a00ea3e442ebe317" -dependencies = [ - "syntex_errors", - "syntex_syntax", -] - -[[package]] -name = "syntex_errors" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04c48f32867b6114449155b2a82114b86d4b09e1bddb21c47ff104ab9172b646" -dependencies = [ - "libc", - "log 0.3.9", - "rustc-serialize", - "syntex_pos", - "term", - "unicode-xid 0.0.3", -] - -[[package]] -name = "syntex_pos" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fd49988e52451813c61fecbe9abb5cfd4e1b7bb6cdbb980a6fbcbab859171a6" -dependencies = [ - "rustc-serialize", -] - -[[package]] -name = "syntex_syntax" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7628a0506e8f9666fdabb5f265d0059b059edac9a3f810bda077abb5d826bd8d" -dependencies = [ - "bitflags 0.5.0", - "libc", - "log 0.3.9", - "rustc-serialize", - "syntex_errors", - "syntex_pos", - "term", - "unicode-xid 0.0.3", + "unicode-xid", ] [[package]] @@ -2100,20 +1952,10 @@ checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" dependencies = [ "cfg-if 1.0.0", "libc", - "rand 0.8.4", + "rand", "redox_syscall", "remove_dir_all", - "winapi 0.3.9", -] - -[[package]] -name = "term" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa63644f74ce96fbeb9b794f66aff2a52d601cbd5e80f4b97123e3899f4570f1" -dependencies = [ - "kernel32-sys", - "winapi 0.2.8", + "winapi", ] [[package]] @@ -2127,18 +1969,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.25" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa6f76457f59514c7eeb4e59d891395fab0b2fd1d40723ae737d64153392e9c6" +checksum = "93119e4feac1cbe6c798c34d3a53ea0026b0b1de6a120deef895137c0529bfe2" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.25" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a36768c0fbf1bb15eca10defa29526bda730a2376c2ab4393ccfa16fb1a318d" +checksum = "060d69a0afe7796bf42e9e2ff91f5ee691fb15c53d38b4b62a9a53eb23164745" dependencies = [ "proc-macro2", "quote", @@ -2152,14 +1994,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" dependencies = [ "libc", - "winapi 0.3.9", + "winapi", ] [[package]] name = "tinyvec" -version = "1.2.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b5220f05bb7de7f3f53c7c065e1199b3172696fe2db9f9c4d8ad9b4ee74c342" +checksum = "848a1e1181b9f6753b5e96a092749e29b11d19ede67dfbbd6c7dc7e0f49b5338" dependencies = [ "tinyvec_macros", ] @@ -2172,12 +2014,12 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.7.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fb2ed024293bb19f7a5dc54fe83bf86532a44c12a2bb8ba40d64a4509395ca2" +checksum = "01cf844b23c6131f624accf65ce0e4e9956a8bb329400ea5bcc26ae3a5c20b0b" dependencies = [ "autocfg 1.0.1", - "bytes 1.0.1", + "bytes", "libc", "memchr", "mio", @@ -2186,14 +2028,14 @@ dependencies = [ "pin-project-lite", "signal-hook-registry", "tokio-macros", - "winapi 0.3.9", + "winapi", ] [[package]] name = "tokio-macros" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c49e3df43841dafb86046472506755d8501c5615673955f6aa17181125d13c37" +checksum = "54473be61f4ebe4efd09cec9bd5d16fa51d70ea0192213d754d2d500457db110" dependencies = [ "proc-macro2", "quote", @@ -2223,9 +2065,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8864d706fdb3cc0843a49647ac892720dac98a6eeb818b77190592cf4994066" +checksum = "7b2f3f698253f03119ac0102beaa64f67a67e08074d03a22d18784104543727f" dependencies = [ "futures-core", "pin-project-lite", @@ -2238,10 +2080,10 @@ version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1caa0b0c8d94a049db56b5acf8cba99dc0623aab1b26d5b5f5e2d945846b3592" dependencies = [ - "bytes 1.0.1", + "bytes", "futures-core", "futures-sink", - "log 0.4.14", + "log", "pin-project-lite", "tokio", ] @@ -2259,7 +2101,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d" dependencies = [ "cfg-if 1.0.0", - "log 0.4.14", + "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -2301,46 +2143,27 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" -[[package]] -name = "tungstenite" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0308d80d86700c5878b9ef6321f020f29b1bb9d5ff3cab25e75e23f3a492a23" -dependencies = [ - "base64 0.12.3", - "byteorder", - "bytes 0.5.6", - "http", - "httparse", - "input_buffer 0.3.1", - "log 0.4.14", - "rand 0.7.3", - "sha-1", - "url", - "utf-8", -] - [[package]] name = "tungstenite" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5fe8dada8c1a3aeca77d6b51a4f1314e0f4b8e438b7b1b71e3ddaca8080e4093" dependencies = [ - "base64 0.13.0", + "base64", "byteorder", - "bytes 1.0.1", + "bytes", "http", "httparse", - "input_buffer 0.4.0", - "log 0.4.14", - "rand 0.8.4", + "input_buffer", + "log", + "rand", "rustls", "sha-1", "thiserror", "url", "utf-8", "webpki", - "webpki-roots 0.21.1", + "webpki-roots", ] [[package]] @@ -2366,12 +2189,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeb8be209bb1c96b7c177c7420d26e04eccacb0eeae6b980e35fcb74678107e0" -dependencies = [ - "matches", -] +checksum = "246f4c42e67e7a4e3c6106ff716a5d067d4132a642840b242e357e468a2a0085" [[package]] name = "unicode-normalization" @@ -2384,15 +2204,9 @@ dependencies = [ [[package]] name = "unicode-segmentation" -version = "1.7.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb0d2e7be6ae3a5fa87eed5fb451aff96f2573d2694942e40543ae0bbe19c796" - -[[package]] -name = "unicode-xid" -version = "0.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36dff09cafb4ec7c8cf0023eb0b686cb6ce65499116a12201c9e11840ca01beb" +checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" [[package]] name = "unicode-xid" @@ -2408,9 +2222,9 @@ checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" [[package]] name = "universal-hash" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8326b2c654932e3e4f9196e69d08fdf7cfd718e1dc6f66b347e6024a0c961402" +checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" dependencies = [ "generic-array", "subtle", @@ -2432,6 +2246,7 @@ dependencies = [ "idna", "matches", "percent-encoding", + "serde", ] [[package]] @@ -2446,7 +2261,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" dependencies = [ - "getrandom 0.2.3", + "getrandom", ] [[package]] @@ -2473,16 +2288,10 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" dependencies = [ - "log 0.4.14", + "log", "try-lock", ] -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" - [[package]] name = "wasi" version = "0.10.2+wasi-snapshot-preview1" @@ -2491,9 +2300,9 @@ checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" [[package]] name = "wasm-bindgen" -version = "0.2.74" +version = "0.2.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54ee1d4ed486f78874278e63e4069fc1ab9f6a18ca492076ffb90c5eb2997fd" +checksum = "b608ecc8f4198fe8680e2ed18eccab5f0cd4caaf3d83516fa5fb2e927fda2586" dependencies = [ "cfg-if 1.0.0", "serde", @@ -2503,13 +2312,13 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.74" +version = "0.2.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b33f6a0694ccfea53d94db8b2ed1c3a8a4c86dd936b13b9f0a15ec4a451b900" +checksum = "580aa3a91a63d23aac5b6b267e2d13cb4f363e31dce6c352fca4752ae12e479f" dependencies = [ "bumpalo", "lazy_static", - "log 0.4.14", + "log", "proc-macro2", "quote", "syn", @@ -2518,9 +2327,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.24" +version = "0.4.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fba7978c679d53ce2d0ac80c8c175840feb849a161664365d1287b41f2e67f1" +checksum = "16646b21c3add8e13fdb8f20172f8a28c3dbf62f45406bcff0233188226cfe0c" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -2530,9 +2339,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.74" +version = "0.2.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "088169ca61430fe1e58b8096c24975251700e7b1f6fd91cc9d59b04fb9b18bd4" +checksum = "171ebf0ed9e1458810dfcb31f2e766ad6b3a89dbda42d8901f2b268277e5f09c" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2540,9 +2349,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.74" +version = "0.2.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be2241542ff3d9f241f5e2cb6dd09b37efe786df8851c54957683a49f0987a97" +checksum = "6c2657dd393f03aa2a659c25c6ae18a13a4048cebd220e147933ea837efc589f" dependencies = [ "proc-macro2", "quote", @@ -2553,15 +2362,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.74" +version = "0.2.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7cff876b8f18eed75a66cf49b65e7f967cb354a7aa16003fb55dbfd25b44b4f" +checksum = "2e0c4a743a309662d45f4ede961d7afa4ba4131a59a639f29b0069c3798bbcc2" [[package]] name = "web-sys" -version = "0.3.51" +version = "0.3.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e828417b379f3df7111d3a2a9e5753706cae29c41f7c4029ee9fd77f3e09e582" +checksum = "01c70a82d842c9979078c772d4a1344685045f1a5628f677c2b2eab4dd7d2696" dependencies = [ "js-sys", "wasm-bindgen", @@ -2577,15 +2386,6 @@ dependencies = [ "untrusted", ] -[[package]] -name = "webpki-roots" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f20dea7535251981a9670857150d571846545088359b28e4951d350bdaf179f" -dependencies = [ - "webpki", -] - [[package]] name = "webpki-roots" version = "0.21.1" @@ -2605,12 +2405,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "winapi" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" - [[package]] name = "winapi" version = "0.3.9" @@ -2621,12 +2415,6 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu", ] -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" - [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" @@ -2639,7 +2427,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2654,7 +2442,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2665,13 +2453,13 @@ checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" [[package]] name = "xsalsa20poly1305" -version = "0.6.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0304c336e98d753428f7b3d8899d60b8a87a961ef50bdfc44af0c1bea2651ce5" +checksum = "2e0f69b133860e3614a4d4fdd6f0d7fe3219e9d67a7e8cd537676a4ebc8313db" dependencies = [ "aead", "poly1305", - "rand_core 0.5.1", + "rand_core", "salsa20", "subtle", "zeroize", diff --git a/Cargo.toml b/Cargo.toml index ff7c5e3..c39a27a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "soundfx-rs" -version = "1.3.1" +version = "1.4.0" authors = ["jellywx "] edition = "2018" [dependencies] -songbird = { path = "/home/jude/songbird" } -serenity = { path = "/home/jude/serenity", features = ["voice", "collector", "unstable_discord_api"] } +songbird = { git = "https://github.com/serenity-rs/songbird", branch = "next" } +serenity = { git = "https://github.com/serenity-rs/serenity", branch = "next", features = ["voice", "collector", "unstable_discord_api"] } sqlx = { version = "0.5", default-features = false, features = ["runtime-tokio-rustls", "macros", "mysql", "bigdecimal"] } dotenv = "0.15" tokio = { version = "1", features = ["fs", "process", "io-util"] } diff --git a/regex_command_attr/src/structures.rs b/regex_command_attr/src/structures.rs index 302a0b0..0cab491 100644 --- a/regex_command_attr/src/structures.rs +++ b/regex_command_attr/src/structures.rs @@ -296,7 +296,9 @@ impl ApplicationCommandOptionType { impl ToTokens for ApplicationCommandOptionType { fn to_tokens(&self, stream: &mut TokenStream2) { - let path = quote!(serenity::model::interactions::ApplicationCommandOptionType); + let path = quote!( + serenity::model::interactions::application_command::ApplicationCommandOptionType + ); let variant = match self { ApplicationCommandOptionType::SubCommand => quote!(SubCommand), ApplicationCommandOptionType::SubCommandGroup => quote!(SubCommandGroup), diff --git a/src/cmds/info.rs b/src/cmds/info.rs index b5843c6..cf0a876 100644 --- a/src/cmds/info.rs +++ b/src/cmds/info.rs @@ -192,7 +192,7 @@ async fn info( invoke: &(dyn CommandInvoke + Sync + Send), _args: Args, ) -> CommandResult { - let current_user = ctx.cache.current_user().await; + let current_user = ctx.cache.current_user(); invoke.respond(ctx.http.clone(), CreateGenericResponse::new() .embed(|e| e diff --git a/src/cmds/manage.rs b/src/cmds/manage.rs index 594b4b6..8b1356c 100644 --- a/src/cmds/manage.rs +++ b/src/cmds/manage.rs @@ -225,7 +225,7 @@ pub async fn delete_sound( } else { let has_perms = { if let Ok(member) = invoke.member(&ctx).await { - if let Ok(perms) = member.permissions(&ctx).await { + if let Ok(perms) = member.permissions(&ctx) { perms.manage_guild() } else { false diff --git a/src/cmds/play.rs b/src/cmds/play.rs index 55583cc..7f3bcf9 100644 --- a/src/cmds/play.rs +++ b/src/cmds/play.rs @@ -4,7 +4,7 @@ use serenity::{ builder::CreateActionRow, client::Context, framework::standard::CommandResult, - model::interactions::{ButtonStyle, InteractionResponseType}, + model::interactions::{message_component::ButtonStyle, InteractionResponseType}, }; use songbird::{ @@ -42,7 +42,7 @@ pub async fn play( invoke: &(dyn CommandInvoke + Sync + Send), args: Args, ) -> CommandResult { - let guild = invoke.guild(ctx.cache.clone()).await.unwrap(); + let guild = invoke.guild(ctx.cache.clone()).unwrap(); invoke .respond( @@ -72,7 +72,7 @@ pub async fn loop_play( invoke: &(dyn CommandInvoke + Sync + Send), args: Args, ) -> CommandResult { - let guild = invoke.guild(ctx.cache.clone()).await.unwrap(); + let guild = invoke.guild(ctx.cache.clone()).unwrap(); invoke .respond( @@ -101,7 +101,7 @@ pub async fn play_ambience( invoke: &(dyn CommandInvoke + Sync + Send), args: Args, ) -> CommandResult { - let guild = invoke.guild(ctx.cache.clone()).await.unwrap(); + let guild = invoke.guild(ctx.cache.clone()).unwrap(); let channel_to_join = guild .voice_states diff --git a/src/event_handlers.rs b/src/event_handlers.rs index 7174750..d6609b2 100644 --- a/src/event_handlers.rs +++ b/src/event_handlers.rs @@ -14,7 +14,7 @@ use serenity::{ gateway::{Activity, Ready}, guild::Guild, id::GuildId, - interactions::Interaction, + interactions::{Interaction, InteractionResponseType}, voice::VoiceState, }, utils::shard_id, @@ -22,9 +22,8 @@ use serenity::{ use songbird::{Event, EventContext, EventHandler as SongbirdEventHandler}; -use crate::framework::{Args, CommandInvoke}; -use serenity::model::interactions::{InteractionData, InteractionType}; -use serenity::model::prelude::InteractionResponseType; +use crate::framework::Args; + use std::{collections::HashMap, env}; pub struct RestartTrack; @@ -63,13 +62,12 @@ impl EventHandler for Handler { async fn guild_create(&self, ctx: Context, guild: Guild, is_new: bool) { if is_new { if let Ok(token) = env::var("DISCORDBOTS_TOKEN") { - let shard_count = ctx.cache.shard_count().await; + let shard_count = ctx.cache.shard_count(); let current_shard_id = shard_id(guild.id.as_u64().to_owned(), shard_count); let guild_count = ctx .cache .guilds() - .await .iter() .filter(|g| shard_id(g.as_u64().to_owned(), shard_count) == current_shard_id) .count() as u64; @@ -91,7 +89,7 @@ impl EventHandler for Handler { .post( format!( "https://top.gg/api/bots/{}/stats", - ctx.cache.current_user_id().await.as_u64() + ctx.cache.current_user_id().as_u64() ) .as_str(), ) @@ -117,8 +115,7 @@ impl EventHandler for Handler { if let Some(past_state) = old { if let (Some(guild_id), None) = (guild_id_opt, new.channel_id) { if let Some(channel_id) = past_state.channel_id { - if let Some(Channel::Guild(channel)) = channel_id.to_channel_cached(&ctx).await - { + if let Some(Channel::Guild(channel)) = channel_id.to_channel_cached(&ctx) { if channel.members(&ctx).await.map(|m| m.len()).unwrap_or(0) <= 1 { let songbird = songbird::get(&ctx).await.unwrap(); @@ -128,7 +125,7 @@ impl EventHandler for Handler { } } } else if let (Some(guild_id), Some(user_channel)) = (guild_id_opt, new.channel_id) { - if let Some(guild) = ctx.cache.guild(guild_id).await { + if let Some(guild) = ctx.cache.guild(guild_id) { let pool = ctx .data .read() @@ -183,12 +180,12 @@ SELECT name, id, plays, public, server_id, uploader_id } async fn interaction_create(&self, ctx: Context, interaction: Interaction) { - if interaction.guild_id.is_none() { - return; - } + match interaction { + Interaction::ApplicationCommand(application_command) => { + if application_command.guild_id.is_none() { + return; + } - match interaction.kind { - InteractionType::ApplicationCommand => { let framework = ctx .data .read() @@ -197,33 +194,34 @@ SELECT name, id, plays, public, server_id, uploader_id .cloned() .expect("RegexFramework not found in context"); - framework.execute(ctx, interaction).await; + framework.execute(ctx, application_command).await; } - InteractionType::MessageComponent => { - if let (Some(InteractionData::MessageComponent(data)), Some(member)) = - (interaction.clone().data, interaction.clone().member) - { - let mut args = Args { - args: Default::default(), - }; - args.args.insert("query".to_string(), data.custom_id); - - play_from_query( - &ctx, - interaction.guild(ctx.cache.clone()).await.unwrap(), - member.user.id, - args, - false, - ) - .await; - - interaction - .create_interaction_response(ctx, |r| { - r.kind(InteractionResponseType::DeferredUpdateMessage) - }) - .await - .unwrap(); + Interaction::MessageComponent(component) => { + if component.guild_id.is_none() { + return; } + + let mut args = Args { + args: Default::default(), + }; + args.args + .insert("query".to_string(), component.data.custom_id.clone()); + + play_from_query( + &ctx, + component.guild_id.unwrap().to_guild_cached(&ctx).unwrap(), + component.user.id, + args, + false, + ) + .await; + + component + .create_interaction_response(ctx, |r| { + r.kind(InteractionResponseType::DeferredUpdateMessage) + }) + .await + .unwrap(); } _ => {} } diff --git a/src/framework.rs b/src/framework.rs index 13beec0..974693e 100644 --- a/src/framework.rs +++ b/src/framework.rs @@ -10,8 +10,12 @@ use serenity::{ channel::{Channel, GuildChannel, Message}, guild::{Guild, Member}, id::{ChannelId, GuildId, UserId}, - interactions::{ApplicationCommand, Interaction, InteractionData}, - prelude::{ApplicationCommandOptionType, InteractionResponseType}, + interactions::{ + application_command::{ + ApplicationCommand, ApplicationCommandInteraction, ApplicationCommandOptionType, + }, + InteractionResponseType, + }, }, prelude::TypeMapKey, Result as SerenityResult, @@ -126,11 +130,11 @@ impl CreateGenericResponse { pub trait CommandInvoke { fn channel_id(&self) -> ChannelId; fn guild_id(&self) -> Option; - async fn guild(&self, cache: Arc) -> Option; + fn guild(&self, cache: Arc) -> Option; fn author_id(&self) -> UserId; async fn member(&self, context: &Context) -> SerenityResult; fn msg(&self) -> Option; - fn interaction(&self) -> Option; + fn interaction(&self) -> Option; async fn respond( &self, http: Arc, @@ -153,8 +157,8 @@ impl CommandInvoke for Message { self.guild_id } - async fn guild(&self, cache: Arc) -> Option { - self.guild(cache).await + fn guild(&self, cache: Arc) -> Option { + self.guild(cache) } fn author_id(&self) -> UserId { @@ -169,7 +173,7 @@ impl CommandInvoke for Message { Some(self.clone()) } - fn interaction(&self) -> Option { + fn interaction(&self) -> Option { None } @@ -187,7 +191,10 @@ impl CommandInvoke for Message { } if let Some(components) = generic_response.components { - m.set_components(components.clone()); + m.components(|c| { + *c = components; + c + }); } m @@ -210,7 +217,10 @@ impl CommandInvoke for Message { } if let Some(components) = generic_response.components { - m.set_components(components.clone()); + m.components(|c| { + *c = components; + c + }); } m @@ -221,18 +231,18 @@ impl CommandInvoke for Message { } #[async_trait] -impl CommandInvoke for Interaction { +impl CommandInvoke for ApplicationCommandInteraction { fn channel_id(&self) -> ChannelId { - self.channel_id.unwrap() + self.channel_id } fn guild_id(&self) -> Option { self.guild_id } - async fn guild(&self, cache: Arc) -> Option { + fn guild(&self, cache: Arc) -> Option { if let Some(guild_id) = self.guild_id { - guild_id.to_guild_cached(cache).await + guild_id.to_guild_cached(cache) } else { None } @@ -250,7 +260,7 @@ impl CommandInvoke for Interaction { None } - fn interaction(&self) -> Option { + fn interaction(&self) -> Option { Some(self.clone()) } @@ -269,7 +279,10 @@ impl CommandInvoke for Interaction { } if let Some(components) = generic_response.components { - d.set_components(components.clone()); + d.components(|c| { + *c = components; + c + }); } d @@ -292,7 +305,10 @@ impl CommandInvoke for Interaction { } if let Some(components) = generic_response.components { - d.set_components(components.clone()); + d.components(|c| { + *c = components; + c + }); } d @@ -652,63 +668,64 @@ impl RegexFramework { info!("{} slash commands built! Ready to go", count); } - pub async fn execute(&self, ctx: Context, interaction: Interaction) { - if let Some(InteractionData::ApplicationCommand(data)) = interaction.data.clone() { - let command = { - let name = data.name; + pub async fn execute(&self, ctx: Context, interaction: ApplicationCommandInteraction) { + let command = { + self.commands.get(&interaction.data.name).expect(&format!( + "Received invalid command: {}", + interaction.data.name + )) + }; - self.commands - .get(&name) - .expect(&format!("Received invalid command: {}", name)) - }; + if command + .check_permissions( + &ctx, + &interaction.guild(ctx.cache.clone()).unwrap(), + &interaction.clone().member.unwrap(), + ) + .await + { + let mut args = HashMap::new(); - if command - .check_permissions( - &ctx, - &interaction.guild(ctx.cache.clone()).await.unwrap(), - &interaction.member(&ctx).await.unwrap(), - ) - .await + for arg in interaction + .data + .options + .iter() + .filter(|o| o.value.is_some()) { - let mut args = HashMap::new(); - - for arg in data.options.iter().filter(|o| o.value.is_some()) { - args.insert( - arg.name.clone(), - match arg.value.clone().unwrap() { - Value::Bool(b) => { - if b { - arg.name.clone() - } else { - String::new() - } + args.insert( + arg.name.clone(), + match arg.value.clone().unwrap() { + Value::Bool(b) => { + if b { + arg.name.clone() + } else { + String::new() } - Value::Number(n) => n.to_string(), - Value::String(s) => s, - _ => String::new(), - }, - ); - } + } + Value::Number(n) => n.to_string(), + Value::String(s) => s, + _ => String::new(), + }, + ); + } - (command.fun)(&ctx, &interaction, Args { args }) - .await - .unwrap(); - } else if command.required_permissions == PermissionLevel::Managed { - let _ = interaction + (command.fun)(&ctx, &interaction, Args { args }) + .await + .unwrap(); + } else if command.required_permissions == PermissionLevel::Managed { + let _ = interaction .respond( ctx.http.clone(), CreateGenericResponse::new().content("You must either be an Admin or have a role specified in `?roles` to do this command") ) .await; - } else if command.required_permissions == PermissionLevel::Restricted { - let _ = interaction - .respond( - ctx.http.clone(), - CreateGenericResponse::new() - .content("You must be an Admin to do this command"), - ) - .await; - } + } else if command.required_permissions == PermissionLevel::Restricted { + let _ = interaction + .respond( + ctx.http.clone(), + CreateGenericResponse::new().content("You must be an Admin to do this command"), + ) + .await; } } } @@ -725,9 +742,9 @@ impl Framework for RegexFramework { ctx: &Context, channel: &GuildChannel, ) -> SerenityResult { - let user_id = ctx.cache.current_user_id().await; + let user_id = ctx.cache.current_user_id(); - let channel_perms = channel.permissions_for_user(ctx, user_id).await?; + let channel_perms = channel.permissions_for_user(ctx, user_id)?; Ok( if channel_perms.send_messages() && channel_perms.embed_links() { @@ -754,8 +771,8 @@ impl Framework for RegexFramework { if msg.author.bot || msg.content.is_empty() { } // Guild Command - else if let (Some(guild), Some(Channel::Guild(channel))) = - (msg.guild(&ctx).await, msg.channel(&ctx).await) + else if let (Some(guild), Ok(Channel::Guild(channel))) = + (msg.guild(&ctx), msg.channel(&ctx).await) { if let Some(full_match) = self.command_matcher.captures(&msg.content) { if check_prefix(&ctx, &guild, full_match.name("prefix")).await { diff --git a/src/main.rs b/src/main.rs index 04d4c00..5546331 100644 --- a/src/main.rs +++ b/src/main.rs @@ -110,7 +110,7 @@ async fn join_channel( channel_id: ChannelId, ) -> (Arc>, JoinResult<()>) { let songbird = songbird::get(ctx).await.unwrap(); - let current_user = ctx.cache.current_user_id().await; + let current_user = ctx.cache.current_user_id(); let current_voice_state = guild .voice_states @@ -138,9 +138,9 @@ async fn join_channel( let _ = call.lock().await.deafen(true).await; } - if let Some(Channel::Guild(channel)) = channel_id.to_channel_cached(&ctx).await { + if let Some(Channel::Guild(channel)) = channel_id.to_channel_cached(&ctx) { channel - .edit_voice_state(&ctx, ctx.cache.current_user().await, |v| v.suppress(false)) + .edit_voice_state(&ctx, ctx.cache.current_user(), |v| v.suppress(false)) .await; }