diff --git a/Cargo.lock b/Cargo.lock index becb948..7131277 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,18 +4,18 @@ version = 3 [[package]] name = "addr2line" -version = "0.21.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" dependencies = [ "gimli", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "aead" @@ -51,38 +51,26 @@ dependencies = [ "libc", ] -[[package]] -name = "arc-swap" -version = "1.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" - [[package]] name = "arrayvec" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" dependencies = [ "serde", ] [[package]] name = "async-trait" -version = "0.1.80" +version = "0.1.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" +checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.77", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "audiopus" version = "0.3.0-rc.0" @@ -111,17 +99,17 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.71" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -136,6 +124,12 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + [[package]] name = "bitflags" version = "1.3.2" @@ -144,9 +138,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "block-buffer" @@ -171,9 +165,9 @@ checksum = "5ce89b21cab1437276d2650d57e971f9d548a2d9037cc231abdc0562b97498ce" [[package]] name = "bytemuck" -version = "1.16.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78834c15cb5d5efe3452d58b1e8ba890dd62d21907f867f383358198e56ebca5" +checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae" [[package]] name = "byteorder" @@ -183,15 +177,15 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.0" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" [[package]] name = "camino" -version = "1.1.7" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0ec6b951b160caa93cc0c7b209e5a3bff7aae9062213451ac99493cd844c239" +checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" dependencies = [ "serde", ] @@ -220,9 +214,12 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.97" +version = "1.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099a5357d84c4c61eb35fc8eafa9a79a902c2f76911e5747ced4e032edd8d9b4" +checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0" +dependencies = [ + "shlex", +] [[package]] name = "cfg-if" @@ -242,7 +239,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -258,18 +255,18 @@ dependencies = [ [[package]] name = "cmake" -version = "0.1.50" +version = "0.1.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" +checksum = "fb1e43aa7fd152b1f968787f7dbcdeb306d1867ff373c69955211876c053f91a" dependencies = [ "cc", ] [[package]] name = "command_attr" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32f08c85a02e066b7b4f7dcb60eee6ae0793ef7d6452a3547d1f19665df070a9" +checksum = "88da8d7e9fe6f30d8e3fcf72d0f84102b49de70fece952633e8439e89bdc7631" dependencies = [ "proc-macro2", "quote", @@ -288,6 +285,12 @@ dependencies = [ "toml", ] +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + [[package]] name = "core-foundation" version = "0.9.4" @@ -300,42 +303,42 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ "libc", ] [[package]] name = "crc32fast" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] [[package]] name = "crossbeam-channel" -version = "0.5.12" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crypto-common" @@ -363,6 +366,41 @@ dependencies = [ "zeroize", ] +[[package]] +name = "darling" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" +dependencies = [ + "darling_core", + "quote", + "syn 1.0.109", +] + [[package]] name = "dashmap" version = "5.5.3" @@ -404,6 +442,44 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive_builder" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2658621297f2cf68762a6f7dc0bb7e1ff2cfd6583daef8ee0fed6f7ec468ec0" +dependencies = [ + "darling", + "derive_builder_core", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder_core" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2791ea3e372c8495c0bc2033991d76b512cd799d07491fbd6890124db9458bef" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_more" +version = "0.99.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn 2.0.77", +] + [[package]] name = "digest" version = "0.10.7" @@ -487,15 +563,15 @@ checksum = "af9673d8203fcb076b19dfd17e38b3d4ae9f44959416ea532ce72415a6020365" [[package]] name = "fastrand" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "flate2" -version = "1.0.30" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" dependencies = [ "crc32fast", "miniz_oxide", @@ -510,7 +586,7 @@ dependencies = [ "futures-core", "futures-sink", "nanorand", - "spin", + "spin 0.9.8", ] [[package]] @@ -543,6 +619,15 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "from_map" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99f31122ab0445ff8cee420b805f24e07683073815de1dd276ee7d588d301700" +dependencies = [ + "hashmap_derive", +] + [[package]] name = "futures" version = "0.3.30" @@ -599,7 +684,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.77", ] [[package]] @@ -680,9 +765,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" [[package]] name = "glob" @@ -709,37 +794,59 @@ dependencies = [ "tracing", ] -[[package]] -name = "h2" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa82e28a107a8cc405f0839610bdc9b15f1e25ec7d696aa5cf173edbcb1486ab" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http 1.1.0", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - [[package]] name = "hashbrown" version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +[[package]] +name = "hashmap_derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb30bf173e72cc31b5265dac095423ca14e7789ff7c3b0e6096a37a996f12883" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "heck" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", +] + [[package]] name = "hermit-abi" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hls_m3u8" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b906521a5b0e6d2ec07ea0bb855d92a1db30b48812744a645a3b2a1405cb8159" +dependencies = [ + "derive_builder", + "derive_more", + "hex", + "shorthand", + "stable-vec", + "strum", + "thiserror", +] + [[package]] name = "http" version = "0.2.12" @@ -773,34 +880,11 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "http-body" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" -dependencies = [ - "bytes", - "http 1.1.0", -] - -[[package]] -name = "http-body-util" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" -dependencies = [ - "bytes", - "futures-core", - "http 1.1.0", - "http-body 1.0.0", - "pin-project-lite", -] - [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" [[package]] name = "httpdate" @@ -810,17 +894,17 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.28" +version = "0.14.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" dependencies = [ "bytes", "futures-channel", "futures-core", "futures-util", - "h2 0.3.26", + "h2", "http 0.2.12", - "http-body 0.4.6", + "http-body", "httparse", "httpdate", "itoa", @@ -832,26 +916,6 @@ dependencies = [ "want", ] -[[package]] -name = "hyper" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "h2 0.4.5", - "http 1.1.0", - "http-body 1.0.0", - "httparse", - "itoa", - "pin-project-lite", - "smallvec", - "tokio", - "want", -] - [[package]] name = "hyper-rustls" version = "0.24.2" @@ -860,7 +924,7 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", - "hyper 0.14.28", + "hyper", "rustls 0.21.12", "tokio", "tokio-rustls 0.24.1", @@ -873,53 +937,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes", - "hyper 0.14.28", + "hyper", "native-tls", "tokio", "tokio-native-tls", ] -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper 1.3.1", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", -] - -[[package]] -name = "hyper-util" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "http 1.1.0", - "http-body 1.0.0", - "hyper 1.3.1", - "pin-project-lite", - "socket2", - "tokio", - "tower", - "tower-service", - "tracing", -] - [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -938,6 +966,12 @@ dependencies = [ "cc", ] +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "idna" version = "0.5.0" @@ -950,9 +984,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.6" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ "equivalent", "hashbrown", @@ -969,9 +1003,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" [[package]] name = "itoa" @@ -981,46 +1015,18 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ "wasm-bindgen", ] -[[package]] -name = "lavalink-rs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ba892eecbfb64bfa0e4fca87462a33fa8616915a6532d38026267147dd62cdb" -dependencies = [ - "arc-swap", - "bytes", - "dashmap", - "futures", - "http 1.1.0", - "http-body-util", - "hyper 1.3.1", - "hyper-tls 0.6.0", - "hyper-util", - "oneshot", - "serde", - "serde_json", - "serde_qs", - "serenity", - "songbird", - "tokio", - "tokio-tungstenite 0.21.0", - "tracing", - "urlencoding", - "version_check", -] - [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "levenshtein" @@ -1030,9 +1036,9 @@ checksum = "db13adb97ab515a3691f56e4dbab09283d0b86cb45abd991d8634a9d6f501760" [[package]] name = "libc" -version = "0.2.155" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "libredox" @@ -1040,7 +1046,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "libc", ] @@ -1062,9 +1068,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.21" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "loom" @@ -1074,7 +1080,6 @@ checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" dependencies = [ "cfg-if", "generator", - "pin-utils", "scoped-tls", "serde", "serde_json", @@ -1093,9 +1098,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "mime" @@ -1105,9 +1110,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mime_guess" -version = "2.0.4" +version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" dependencies = [ "mime", "unicase", @@ -1130,22 +1135,23 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.7.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" dependencies = [ - "adler", + "adler2", ] [[package]] name = "mio" -version = "0.8.11" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ + "hermit-abi", "libc", "wasi", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1159,11 +1165,10 @@ dependencies = [ [[package]] name = "native-tls" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" dependencies = [ - "lazy_static", "libc", "log", "openssl", @@ -1175,6 +1180,12 @@ dependencies = [ "tempfile", ] +[[package]] +name = "no-std-compat" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df270209a7f04d62459240d890ecb792714d5db12c92937823574a09930276b4" + [[package]] name = "no-std-net" version = "0.6.0" @@ -1242,9 +1253,9 @@ dependencies = [ [[package]] name = "object" -version = "0.32.2" +version = "0.36.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" dependencies = [ "memchr", ] @@ -1255,15 +1266,6 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -[[package]] -name = "oneshot" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f6640c6bda7731b1fdbab747981a0f896dd1fedaf9f4a53fa237a04a84431f4" -dependencies = [ - "loom", -] - [[package]] name = "opaque-debug" version = "0.3.1" @@ -1272,11 +1274,11 @@ checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "openssl" -version = "0.10.64" +version = "0.10.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" +checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cfg-if", "foreign-types", "libc", @@ -1293,7 +1295,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.77", ] [[package]] @@ -1304,9 +1306,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.102" +version = "0.9.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" +checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" dependencies = [ "cc", "libc", @@ -1337,9 +1339,9 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "parking_lot" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -1355,7 +1357,16 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-targets 0.52.5", + "windows-targets 0.52.6", +] + +[[package]] +name = "patricia_tree" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31f2f4539bffe53fc4b4da301df49d114b845b077bd5727b7fe2bd9d8df2ae68" +dependencies = [ + "bitflags 2.6.0", ] [[package]] @@ -1381,7 +1392,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.77", ] [[package]] @@ -1420,7 +1431,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.64", + "syn 2.0.77", ] [[package]] @@ -1451,24 +1462,27 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "primal-check" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9df7f93fd637f083201473dab4fee2db4c429d32e55e3299980ab3957ab916a0" +checksum = "dc0d895b311e3af9902528fbb8f928688abbd95872819320517cc24ca6b2bd08" dependencies = [ "num-integer", ] [[package]] name = "proc-macro2" -version = "1.0.82" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] @@ -1479,16 +1493,16 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57206b407293d2bcd3af849ce869d52068623f19e1b5ff8e8778e3309439682b" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "memchr", "unicase", ] [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -1534,18 +1548,18 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.1" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +checksum = "0884ad60e090bf1345b93da0a5de8923c93884cd03f40dfcfddd3b4bee661853" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", ] [[package]] name = "redox_users" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", "libredox", @@ -1554,14 +1568,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.4" +version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.6", - "regex-syntax 0.8.3", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] @@ -1575,13 +1589,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.3", + "regex-syntax 0.8.4", ] [[package]] @@ -1592,9 +1606,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "reqwest" @@ -1607,12 +1621,12 @@ dependencies = [ "encoding_rs", "futures-core", "futures-util", - "h2 0.3.26", + "h2", "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.28", + "http-body", + "hyper", "hyper-rustls", - "hyper-tls 0.5.0", + "hyper-tls", "ipnet", "js-sys", "log", @@ -1643,6 +1657,21 @@ dependencies = [ "winreg", ] +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin 0.5.2", + "untrusted 0.7.1", + "web-sys", + "winapi", +] + [[package]] name = "ring" version = "0.17.8" @@ -1653,25 +1682,25 @@ dependencies = [ "cfg-if", "getrandom", "libc", - "spin", - "untrusted", + "spin 0.9.8", + "untrusted 0.9.0", "windows-sys 0.52.0", ] [[package]] name = "ringbuf" -version = "0.3.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79abed428d1fd2a128201cec72c5f6938e2da607c6f3745f769fabea399d950a" +checksum = "46f7f1b88601a8ee13cabf203611ccdf64345dc1c5d24de8b11e1a678ee619b6" dependencies = [ "crossbeam-utils", ] [[package]] name = "rubato" -version = "0.14.1" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6dd52e80cfc21894deadf554a5673002938ae4625f7a283e536f9cf7c17b0d5" +checksum = "b5d18b486e7d29a408ef3f825bc1327d8f87af091c987ca2f5b734625940e234" dependencies = [ "num-complex", "num-integer", @@ -1685,14 +1714,22 @@ version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + [[package]] name = "rustendo" -version = "7.0.0" +version = "7.0.4" dependencies = [ "chrono", "confy", "futures", - "lavalink-rs", "lazy_static", "reqwest", "serde", @@ -1723,17 +1760,29 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", "windows-sys 0.52.0", ] +[[package]] +name = "rustls" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" +dependencies = [ + "log", + "ring 0.16.20", + "sct", + "webpki", +] + [[package]] name = "rustls" version = "0.21.12" @@ -1741,7 +1790,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", - "ring", + "ring 0.17.8", "rustls-webpki 0.101.7", "sct", ] @@ -1753,13 +1802,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" dependencies = [ "log", - "ring", + "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.4", + "rustls-webpki 0.102.8", "subtle", "zeroize", ] +[[package]] +name = "rustls-native-certs" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", +] + [[package]] name = "rustls-pemfile" version = "1.0.4" @@ -1771,9 +1832,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" +checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" [[package]] name = "rustls-webpki" @@ -1781,19 +1842,19 @@ version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring", - "untrusted", + "ring 0.17.8", + "untrusted 0.9.0", ] [[package]] name = "rustls-webpki" -version = "0.102.4" +version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ - "ring", + "ring 0.17.8", "rustls-pki-types", - "untrusted", + "untrusted 0.9.0", ] [[package]] @@ -1841,11 +1902,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1866,8 +1927,8 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring", - "untrusted", + "ring 0.17.8", + "untrusted 0.9.0", ] [[package]] @@ -1882,11 +1943,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.11.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "core-foundation", "core-foundation-sys", "libc", @@ -1895,9 +1956,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" +checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" dependencies = [ "core-foundation-sys", "libc", @@ -1914,9 +1975,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.202" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "226b61a0d411b2ba5ff6d7f73a476ac4f8bb900373459cd00fab8512828ba395" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] @@ -1943,38 +2004,37 @@ dependencies = [ ] [[package]] -name = "serde_derive" -version = "1.0.202" +name = "serde_cow" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6048858004bcff69094cd972ed40a32500f153bd3be9f716b2eed2e8217c4838" +checksum = "1e7bbbec7196bfde255ab54b65e34087c0849629280028238e67ee25d6a4b7da" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.210" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.77", ] [[package]] name = "serde_json" -version = "1.0.117" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] -[[package]] -name = "serde_qs" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd34f36fe4c5ba9654417139a9b3a20d2e1de6012ee678ad14d240c22c78d8d6" -dependencies = [ - "percent-encoding", - "serde", - "thiserror", -] - [[package]] name = "serde_repr" version = "0.1.19" @@ -1983,14 +2043,14 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.77", ] [[package]] name = "serde_spanned" -version = "0.6.6" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" +checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" dependencies = [ "serde", ] @@ -2009,14 +2069,14 @@ dependencies = [ [[package]] name = "serenity" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c64da29158bb55d70677cacd4f4f8eab1acef005fb830d9c3bea411b090e96a9" +checksum = "880a04106592d0a8f5bdacb1d935889bfbccb4a14f7074984d9cd857235d34ac" dependencies = [ "arrayvec", "async-trait", - "base64 0.21.7", - "bitflags 2.5.0", + "base64 0.22.1", + "bitflags 2.6.0", "bytes", "chrono", "command_attr", @@ -2031,6 +2091,7 @@ dependencies = [ "reqwest", "secrecy", "serde", + "serde_cow", "serde_json", "static_assertions", "time", @@ -2049,7 +2110,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "593682f6155d07c8b331b3d1060f5aab7e6796caca9f2f66bd9e6855c880e06b" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "num-traits", "serde", "serde_json", @@ -2076,6 +2137,24 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "shorthand" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "474f77f985d8212610f170332eaf173e768404c0c1d4deb041f32c297cf18931" +dependencies = [ + "from_map", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "signal-hook-registry" version = "1.4.2" @@ -2127,13 +2206,14 @@ dependencies = [ [[package]] name = "songbird" -version = "0.4.1" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54d70e66a385ea8f732afac37b6ff2a8334eccac9aeed3d162a3c550b059233a" +checksum = "338dd182f9f084f583c4c0db38588e28a34778ecec288208cf0b61c378ac90d1" dependencies = [ "async-trait", "audiopus", "byteorder", + "bytes", "crypto_secretbox", "dashmap", "derivative", @@ -2155,6 +2235,7 @@ dependencies = [ "serenity", "serenity-voice-model", "socket2", + "stream_lib", "streamcatcher", "symphonia", "symphonia-core", @@ -2169,6 +2250,12 @@ dependencies = [ "uuid", ] +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + [[package]] name = "spin" version = "0.9.8" @@ -2178,12 +2265,38 @@ dependencies = [ "lock_api", ] +[[package]] +name = "stable-vec" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1dff32a2ce087283bec878419027cebd888760d8760b2941ad0843531dc9ec8" +dependencies = [ + "no-std-compat", +] + [[package]] name = "static_assertions" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "stream_lib" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa3f10eb5a7054e17abf61d310e4e29108187a847591c63c4c79b6a74898a5a7" +dependencies = [ + "bytes", + "futures-core", + "futures-util", + "hls_m3u8", + "patricia_tree", + "reqwest", + "tokio", + "tracing", + "url", +] + [[package]] name = "streamcatcher" version = "1.0.1" @@ -2202,10 +2315,37 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe895eb47f22e2ddd4dabc02bce419d2e643c8e3b585c78158b349195bc24d82" [[package]] -name = "subtle" -version = "2.5.0" +name = "strsim" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" + +[[package]] +name = "strum" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "530efb820d53b712f4e347916c5e7ed20deb76a4f0457943b3182fb889b06d2c" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6e163a520367c465f59e0a61a23cfae3b10b6546d78b6f672a382be79f7110" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "symphonia" @@ -2353,9 +2493,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.64" +version = "2.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ad3dee41f36859875573074334c200d1add8e4a87bb37113ebd31d926b7b11f" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" dependencies = [ "proc-macro2", "quote", @@ -2397,34 +2537,35 @@ checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" [[package]] name = "tempfile" -version = "3.10.1" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" dependencies = [ "cfg-if", "fastrand", + "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "thiserror" -version = "1.0.61" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.61" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.77", ] [[package]] @@ -2470,9 +2611,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -2485,31 +2626,30 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.37.0" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" dependencies = [ "backtrace", "bytes", "libc", "mio", - "num_cpus", "pin-project-lite", "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.77", ] [[package]] @@ -2522,6 +2662,17 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-rustls" +version = "0.23.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +dependencies = [ + "rustls 0.20.9", + "tokio", + "webpki", +] + [[package]] name = "tokio-rustls" version = "0.24.1" @@ -2551,10 +2702,12 @@ checksum = "54319c93411147bced34cb5609a80e0a8e44c5999c93903a81cd866630ec0bfd" dependencies = [ "futures-util", "log", - "native-tls", + "rustls 0.20.9", + "rustls-native-certs", "tokio", - "tokio-native-tls", + "tokio-rustls 0.23.4", "tungstenite 0.18.0", + "webpki", ] [[package]] @@ -2565,21 +2718,19 @@ checksum = "c83b561d025642014097b66e6c1bb422783339e0909e4429cde4749d1990bc38" dependencies = [ "futures-util", "log", - "native-tls", "rustls 0.22.4", "rustls-pki-types", "tokio", - "tokio-native-tls", "tokio-rustls 0.25.0", "tungstenite 0.21.0", - "webpki-roots 0.26.1", + "webpki-roots 0.26.5", ] [[package]] name = "tokio-util" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ "bytes", "futures-core", @@ -2590,9 +2741,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.13" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4e43f8cc456c9704c851ae29c67e17ef65d2c30017c17a9765b89c382dc8bba" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" dependencies = [ "serde", "serde_spanned", @@ -2602,18 +2753,18 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.6" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.22.13" +version = "0.22.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c127785850e8c20836d49732ae6abfa47616e60bf9d9f57c43c250361a9db96c" +checksum = "3b072cee73c449a636ffd6f32bd8de3a9f7119139aff882f44943ce2986dc5cf" dependencies = [ "indexmap", "serde", @@ -2622,33 +2773,11 @@ dependencies = [ "winnow", ] -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "pin-project", - "pin-project-lite", - "tokio", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower-layer" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" - [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -2670,7 +2799,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.77", ] [[package]] @@ -2734,9 +2863,9 @@ dependencies = [ [[package]] name = "triomphe" -version = "0.1.11" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859eb650cfee7434994602c3a68b25d77ad9e68c8a6cd491616ef86661382eb3" +checksum = "e6631e42e10b40c0690bf92f404ebcfe6e1fdb480391d15f17cc8e96eeed5369" [[package]] name = "try-lock" @@ -2756,12 +2885,13 @@ dependencies = [ "http 0.2.12", "httparse", "log", - "native-tls", "rand", + "rustls 0.20.9", "sha1", "thiserror", "url", "utf-8", + "webpki", ] [[package]] @@ -2776,7 +2906,6 @@ dependencies = [ "http 1.1.0", "httparse", "log", - "native-tls", "rand", "rustls 0.22.4", "rustls-pki-types", @@ -2794,8 +2923,9 @@ checksum = "30be5c7e2b13b4a59e0f93344c070c23404279a318a324eece1f4384ead47d86" dependencies = [ "bitflags 1.3.2", "futures-util", - "native-tls", "rand", + "rustls 0.20.9", + "rustls-native-certs", "serde", "serde_json", "tokio", @@ -2842,9 +2972,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "typesize" -version = "0.1.7" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb704842c709bc76f63e99e704cb208beeccca2abbabd0d9aec02e48ca1cee0f" +checksum = "5dece5c06268af6a9ff4541788601e560a4284ffebfb357f713d676f13b964db" dependencies = [ "chrono", "dashmap", @@ -2866,7 +2996,7 @@ checksum = "905e88c2a4cc27686bd57e495121d451f027e441388a67f773be729ad4be1ea8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.77", ] [[package]] @@ -2886,19 +3016,25 @@ checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-normalization" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-segmentation" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" + [[package]] name = "universal-hash" version = "0.5.1" @@ -2909,6 +3045,12 @@ dependencies = [ "subtle", ] +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + [[package]] name = "untrusted" version = "0.9.0" @@ -2917,9 +3059,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", @@ -2927,12 +3069,6 @@ dependencies = [ "serde", ] -[[package]] -name = "urlencoding" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" - [[package]] name = "utf-8" version = "0.7.6" @@ -2941,9 +3077,9 @@ checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" [[package]] name = "uuid" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" +checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" dependencies = [ "getrandom", ] @@ -2968,9 +3104,9 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "walkdir" @@ -2999,34 +3135,35 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.77", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.42" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" dependencies = [ "cfg-if", "js-sys", @@ -3036,9 +3173,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3046,22 +3183,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.77", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "wasm-streams" @@ -3078,14 +3215,24 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" dependencies = [ "js-sys", "wasm-bindgen", ] +[[package]] +name = "webpki" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" +dependencies = [ + "ring 0.17.8", + "untrusted 0.9.0", +] + [[package]] name = "webpki-roots" version = "0.25.4" @@ -3094,9 +3241,9 @@ checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "webpki-roots" -version = "0.26.1" +version = "0.26.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3de34ae270483955a94f4b21bdaaeb83d508bb84a01435f393818edb0012009" +checksum = "0bd24728e5af82c6c4ec1b66ac4844bdf8156257fccda846ec58b42cd0cdbe6a" dependencies = [ "rustls-pki-types", ] @@ -3119,11 +3266,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -3147,7 +3294,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -3165,7 +3312,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -3185,18 +3341,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -3207,9 +3363,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -3219,9 +3375,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -3231,15 +3387,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -3249,9 +3405,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -3261,9 +3417,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -3273,9 +3429,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -3285,15 +3441,15 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.8" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c52e9c97a68071b23e836c9380edae937f17b9c4667bd021973efc689f618d" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" dependencies = [ "memchr", ] @@ -3309,7 +3465,28 @@ dependencies = [ ] [[package]] -name = "zeroize" -version = "1.7.0" +name = "zerocopy" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/Cargo.toml b/Cargo.toml index f3d5fa5..de15d83 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rustendo" -version = "7.0.0" +version = "7.0.4" authors = ["moonleay ", "migueldamota "] edition = "2021" @@ -9,14 +9,13 @@ edition = "2021" [dependencies] serenity = "0.12" -tokio = { version = "1", features = ["macros", "rt-multi-thread"] } +tokio = { version = "1.39", features = ["macros", "rt-multi-thread"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" confy = "0.6.0" -songbird = { version = "0.4", features = ["gateway", "serenity", "native", "driver"], default-features = false } -lavalink-rs = { version = "0.12", features = ["songbird", "serenity", "native-tls"], default-features = false } +songbird = "0.4" chrono = "0.4" -reqwest = "0.11" +reqwest = "0.11" # 0.12 creates issues; don't update for now, will fix later symphonia = "0.5" tracing = "0.1.40" tracing-subscriber = "0.3.18" diff --git a/Dockerfile b/Dockerfile index b94baf4..9321e7c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,11 @@ -FROM rust:1.77 +FROM rust:1.81 WORKDIR /usr/src/app COPY . . +RUN echo 'deb http://deb.debian.org/debian bookworm-backports main' >> /etc/apt/sources.list RUN apt-get update -RUN apt-get install -y cmake yt-dlp +RUN apt-get install -y cmake yt-dlp/bookworm-backports RUN cargo build --release -CMD ["/usr/src/app/target/release/rustendo"] \ No newline at end of file +CMD ["/usr/src/app/target/release/rustendo"] diff --git a/src/commands/now_playing.rs b/src/commands/now_playing.rs index becadda..c90a3f0 100644 --- a/src/commands/now_playing.rs +++ b/src/commands/now_playing.rs @@ -1,12 +1,9 @@ -use std::time::Duration; - -use crate::music::preview::Preview; +use crate::music::music_queue; use crate::util::embed::Embed; -use lavalink_rs::client::LavalinkClient; -use serenity::all::{CommandInteraction, Context, GuildId}; +use serenity::all::{CommandInteraction, Context}; use serenity::builder::{CreateCommand, CreateEmbed}; -pub async fn run(ctx: &Context, command: &CommandInteraction, llc: &LavalinkClient) -> CreateEmbed { +pub async fn run(ctx: &Context, command: &CommandInteraction) -> CreateEmbed { let username = command.user.name.as_str(); let guild_id = match &command.guild_id { @@ -20,27 +17,47 @@ pub async fn run(ctx: &Context, command: &CommandInteraction, llc: &LavalinkClie } }; - let Some(player_context) = llc.get_player_context(guild_id.get()) else { - return Embed::create_error_respose(username, "Not playing", "There is no player context and therefore there is nothing playing."); + let now_plaing = match music_queue::get_now_playing(&guild_id).await { + Some(ytdl) => ytdl, + None => { + return Embed::create_error_respose( + username, + "Not playing", + "I'm not playing anything!", + ); + } }; - let Ok(player) = player_context.get_player().await else { - return Embed::create_error_respose(username, "Can't get player", "Cannot get player from player context."); + let now_handle = match music_queue::get_now_playing_track_handle(&guild_id).await { + Some(handle) => handle, + None => { + return Embed::create_error_respose( + username, + "Cannot get TrackHandle", + "The TrackHandle is empty.", + ); + } }; + let manager = songbird::get(ctx) + .await + .expect("Cannot get Songbird") + .clone(); - if let Some(npt) = player.track { - let npti = npt.info; - let preview_data = Preview { - title: npti.title, - artist: Some(npti.author.to_string()), - duration: Some(npti.length), - thumbnail: npti.artwork_url, - link: npti.uri - }; - let position = Duration::from_millis(player_context.get_player().await.expect("Can't get player").state.position); - - return Embed::create_playing(preview_data, username, "Now playing") + let _ = match manager.get(*guild_id) { + Some(handler) => handler, + None => { + return Embed::create_error_respose( + username, + "Error", + "Error while getting the audio handler.", + ); + } + }; + + let position = now_handle.get_info().await.unwrap().position; + + Embed::create_yt_playing(now_plaing, username, "Currently playing") .await .field( "Position", @@ -49,11 +66,8 @@ pub async fn run(ctx: &Context, command: &CommandInteraction, llc: &LavalinkClie position.as_secs() / 60, position.as_secs() % 60 ), - true - ); - } - - return Embed::create_error_respose(username, "Not playing", "I'm currently not playing anything."); + true, + ) } pub fn register() -> CreateCommand { diff --git a/src/commands/play.rs b/src/commands/play.rs index 18b6e86..78e44d0 100644 --- a/src/commands/play.rs +++ b/src/commands/play.rs @@ -1,13 +1,12 @@ use crate::music::music_manager; -use lavalink_rs::client::LavalinkClient; use serenity::all::{CommandDataOptionValue, CommandInteraction, Context}; use serenity::builder::{CreateCommand, CreateCommandOption, CreateEmbed}; use serenity::model::application::CommandOptionType; use crate::util::embed::Embed; -pub async fn run(ctx: &Context, command: &CommandInteraction, llc: &LavalinkClient) -> CreateEmbed { +pub async fn run(ctx: &Context, command: &CommandInteraction) -> CreateEmbed { let username = command.user.name.as_str(); let options = &command.data.options; @@ -40,7 +39,6 @@ pub async fn run(ctx: &Context, command: &CommandInteraction, llc: &LavalinkClie music_manager::attempt_to_queue_song( ctx, - llc, guild_id, &command.user.id, &command.user.name, diff --git a/src/commands/skip.rs b/src/commands/skip.rs index 58faad1..e5609df 100644 --- a/src/commands/skip.rs +++ b/src/commands/skip.rs @@ -1,10 +1,9 @@ use crate::music::music_manager; use crate::util::embed::Embed; -use lavalink_rs::client::LavalinkClient; use serenity::all::{CommandInteraction, Context}; use serenity::builder::{CreateCommand, CreateEmbed}; -pub async fn run(ctx: &Context, command: &CommandInteraction, llc: &LavalinkClient) -> CreateEmbed { +pub async fn run(ctx: &Context, command: &CommandInteraction) -> CreateEmbed { let username = command.user.name.as_str(); let guild_id = match &command.guild_id { @@ -18,7 +17,7 @@ pub async fn run(ctx: &Context, command: &CommandInteraction, llc: &LavalinkClie } }; - music_manager::attempt_to_skip_current_song(ctx, llc, guild_id, &command.user.id, &command.user.name) + music_manager::attempt_to_skip_current_song(ctx, guild_id, &command.user.id, &command.user.name) .await } diff --git a/src/commands/stop.rs b/src/commands/stop.rs index 326a579..5bc6e78 100644 --- a/src/commands/stop.rs +++ b/src/commands/stop.rs @@ -1,10 +1,9 @@ use crate::music::music_manager; use crate::util::embed::Embed; -use lavalink_rs::client::LavalinkClient; use serenity::all::{CommandInteraction, Context}; use serenity::builder::{CreateCommand, CreateEmbed}; -pub async fn run(ctx: &Context, command: &CommandInteraction, llc: &LavalinkClient) -> CreateEmbed { +pub async fn run(ctx: &Context, command: &CommandInteraction) -> CreateEmbed { let username = command.user.name.as_str(); let guild_id = match &command.guild_id { @@ -18,7 +17,7 @@ pub async fn run(ctx: &Context, command: &CommandInteraction, llc: &LavalinkClie } }; - music_manager::attempt_to_stop(ctx, llc, guild_id, &command.user.id, &command.user.name).await + music_manager::attempt_to_stop(ctx, guild_id, &command.user.id, &command.user.name).await } pub fn register() -> CreateCommand { diff --git a/src/events/lavalink_event_handler.rs b/src/events/lavalink_event_handler.rs deleted file mode 100644 index f994a93..0000000 --- a/src/events/lavalink_event_handler.rs +++ /dev/null @@ -1,30 +0,0 @@ -use lavalink_rs::{client::LavalinkClient, model::events}; -use serenity::all::{standard::macros::hook, Sticker}; - -#[hook] -pub async fn ready_event(client: LavalinkClient, _session_id: String, event: &events::Ready) { - client.delete_all_player_contexts().await.unwrap(); - println!("Lavalink is ready for Freddy:: {:?}", event); -} - -#[hook] -pub async fn track_start(_client: LavalinkClient, _session_id: String, _event: &events::TrackStart) { - -} - -#[hook] -pub async fn track_end_event(_client: LavalinkClient, _session_id: String, _event: &events::TrackEnd) { - -} - -#[hook] -pub async fn track_exception(_client: LavalinkClient, _session_id: String, _event: &events::TrackException) { - -} - -#[hook] -pub async fn track_stuck(_client: LavalinkClient, _session_id: String, _event: &events::TrackStuck) { - -} - - diff --git a/src/events/mod.rs b/src/events/mod.rs deleted file mode 100644 index 5610ef2..0000000 --- a/src/events/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod lavalink_event_handler; \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index c2d1814..fb0bd4e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,15 +1,7 @@ mod commands; mod music; mod util; -mod events; -use std::ops::Deref; - -use lavalink_rs::client::LavalinkClient; -use lavalink_rs::model::client::NodeDistributionStrategy; -use lavalink_rs::model::events::Events; -use lavalink_rs::model::UserId; -use lavalink_rs::node::NodeBuilder; use serenity::all::{ CommandInteraction, CreateInteractionResponseFollowup, OnlineStatus, VoiceState, }; @@ -26,15 +18,19 @@ use util::{config, embed::Embed, user_util}; // The voice client can be retrieved in any command using `songbird::get(ctx).await`. use songbird::SerenityInit; -use crate::events::lavalink_event_handler; +// YtDl requests need an HTTP client to operate -- we'll create and store our own. +use reqwest::Client as HttpClient; + +struct HttpKey; +impl TypeMapKey for HttpKey { + type Value = HttpClient; +} // lazy static stuff. I don't like it, but it has to be here, bc it has to be @ root #[macro_use] extern crate lazy_static; -struct Handler { - pub llc: LavalinkClient -} +struct Handler; #[async_trait] impl EventHandler for Handler { @@ -44,10 +40,10 @@ impl EventHandler for Handler { let content = Some(match command.data.name.as_str() { "info" => commands::info::run(&ctx, &command).await, - "play" => commands::play::run(&ctx, &command, &self.llc).await, - "stop" => commands::stop::run(&ctx, &command, &self.llc).await, - "skip" => commands::skip::run(&ctx, &command, &self.llc).await, - "nowplaying" => commands::now_playing::run(&ctx, &command, &self.llc).await, + "play" => commands::play::run(&ctx, &command).await, + "stop" => commands::stop::run(&ctx, &command).await, + "skip" => commands::skip::run(&ctx, &command).await, + "nowplaying" => commands::now_playing::run(&ctx, &command).await, _ => respond_with_error(&ctx, &command).await, }); @@ -124,35 +120,13 @@ async fn main() { let status = OnlineStatus::DoNotDisturb; let activity = ActivityData::streaming("music", "https://twitch.tv/moonleaytv").unwrap(); - let event = Events { - ready: Some(lavalink_event_handler::ready_event), - // track_start: Some(lavalink_event_handler::track_start), - // track_end: Some(lavalink_event_handler::track_end_event), - // track_exception: Some(lavalink_event_handler::track_exception), - // track_stuck: Some(lavalink_event_handler::track_stuck), - ..Default::default() - }; - - let node_builder = NodeBuilder { - hostname: config.lavalink_address, - password: config.lavalink_password, - user_id: UserId(config.user_id), - is_ssl: false, - events: event.clone(), - session_id: None - }; - - - let lavalink_client = LavalinkClient::new(event, vec![node_builder], NodeDistributionStrategy::round_robin()).await; - // Build the client let mut client = Client::builder(config.discord_token, GatewayIntents::empty()) - .event_handler(Handler{ - llc: lavalink_client - }) + .event_handler(Handler) .status(status) .activity(activity) .register_songbird() + .type_map_insert::(HttpClient::new()) .intents(GatewayIntents::all()) .await .expect("Error creating client"); diff --git a/src/music/mod.rs b/src/music/mod.rs index e9f9def..d99af32 100644 --- a/src/music/mod.rs +++ b/src/music/mod.rs @@ -1,2 +1,3 @@ +pub mod music_events; pub mod music_manager; -pub mod preview; \ No newline at end of file +pub mod music_queue; diff --git a/src/music/music_events.rs b/src/music/music_events.rs new file mode 100644 index 0000000..f35abe9 --- /dev/null +++ b/src/music/music_events.rs @@ -0,0 +1,56 @@ +use crate::music::{music_manager, music_queue}; + +use serenity::all::{ChannelId, GuildId, Http}; +use serenity::async_trait; +use songbird::input::Compose; +use songbird::{Event, EventContext, EventHandler}; +use std::sync::Arc; + +pub struct TrackEndNotifier { + pub guild_id: GuildId, + pub channel_id: ChannelId, + pub http: Arc, + pub cmdctx: Arc, +} + +#[async_trait] +impl EventHandler for TrackEndNotifier { + async fn act(&self, ctx: &EventContext<'_>) -> Option { + // TODO: Does this need to be unsafe? + if let EventContext::Track(..) = ctx { + println!("The track ended!"); + + if music_queue::is_empty(&self.guild_id).await { + // No more songs in queue, exit the vc + let stopped = match music_manager::leave(&self.cmdctx, &self.guild_id).await { + Ok(stopped) => stopped, + Err(e) => { + println!("Cannot stop: {:?}", e); + return None; + } + }; + if stopped { + music_queue::delete_queue(&self.guild_id).await; + println!("Stopped playing successfully."); + } else { + println!("Failed to stop playing."); + } + return None; + } + let mut head = match music_queue::next(&self.guild_id).await { + Some(head) => head, + None => { + println!("Cannot get head of queue"); + return None; + } + }; + println!( + "Now playing: {}", + head.aux_metadata().await.unwrap().title.unwrap() + ); + music_manager::play_song(&self.cmdctx, &self.guild_id, &head).await; + } + + None + } +} diff --git a/src/music/music_manager.rs b/src/music/music_manager.rs index 28678be..3df3dfc 100644 --- a/src/music/music_manager.rs +++ b/src/music/music_manager.rs @@ -1,20 +1,17 @@ +use crate::music::{music_events, music_queue}; use crate::util::embed::Embed; use crate::util::user_util; use crate::util::user_util::get_vc_id; -use crate::music::preview::Preview; -use lavalink_rs::client::LavalinkClient; -use lavalink_rs::model::search::SearchEngines; -use lavalink_rs::model::track::TrackLoadData; -use lavalink_rs::model::ChannelId; -use lavalink_rs::player_context::TrackInQueue; -use serenity::all::{Context, CreateEmbed, GuildId, Http, UserId}; +use crate::HttpKey; +use serenity::all::{Context, CreateEmbed, GuildId, UserId}; use songbird::error::JoinError; +use songbird::input::YoutubeDl; +use songbird::{Event, TrackEvent}; use std::sync::Arc; /// Either queues the song, or start playing it instantly, depending on if there is already a song playing pub async fn attempt_to_queue_song( ctx: &Context, - llc: &LavalinkClient, guild_id: &GuildId, user_id: &UserId, username: &str, @@ -35,38 +32,160 @@ pub async fn attempt_to_queue_song( } }; - let songbird: &Arc = &songbird::get(ctx) // TODO match + let manager: &Arc = &songbird::get(ctx) // TODO match .await .expect("Cannot get Songbird.") .clone(); let self_channel = user_util::get_self_vc_id(ctx, guild_id).await; - if !user_util::is_self_connected_to_vc(ctx, &guild_id).await { + if !user_util::is_self_connected_to_vc(ctx, guild_id).await { // self is connected to vc, check if user is in same vc if self_channel.is_none() { // Connect to VC - let handler = songbird.join_gateway(GuildId::new(guild_id.get()), connect_to).await; - // - match handler { - Ok((connection_info, _)) => { - let Ok(_) = llc - .create_player_context_with_data::<(ChannelId, std::sync::Arc)>( - guild_id.get(), - connection_info, - std::sync::Arc::new(( - ChannelId::from(connect_to.get()), - ctx.http.clone(), - )), - ).await else { - return Embed::create_error_respose(username, "error_title", "error_desc"); - }; - } + manager // TODO match + .join(*guild_id, connect_to) + .await + .expect("Cannot connect>..."); + } + } else { + let self_channel = self_channel.expect("Cannot get self channel"); // TODO: match - Err(_) => { - return Embed::create_error_respose(username, "Cannot join", "Could not join the channel."); - } - } + // Check if user is in the same VC as the bot + if self_channel != connect_to { + return Embed::create_error_respose( + username, + "You are not in my VC", + "You have to be in my VC in order to control the music.", + ); + } + } + + // Get query + let do_search = !query.starts_with("http"); + let http_client = { + let data = ctx.data.read().await; + data.get::() + .cloned() + .expect("Guaranteed to exist in the typemap.") + }; + + if query.contains("youtu") && query.contains("&list=") { + return Embed::create_error_respose( + username, + "Playlists are not supported", + "I do not support playlists of any kind, please only provide links to videos" + ); + } + + // Create source + let src = if do_search { + YoutubeDl::new_search(http_client, query.to_string()) + } else { + YoutubeDl::new(http_client, query.to_string()) + }; + + let currently_playing = music_queue::get_now_playing(guild_id).await; + music_queue::add_to_queue(guild_id, src.clone()).await; + if currently_playing.is_some() { + // Add to queue + return Embed::create_yt_playing(src, username, "Added to queue").await; + } + + let _query = music_queue::next(guild_id) + .await + .expect("Cannot get head of queue"); + music_queue::set_now_playing(guild_id, Some(src.clone())).await; + + let handler_lock = match manager.get(*guild_id) { + Some(handler) => handler, + None => { + return Embed::create_error_respose( + username, + "Error", + "Cannot get handler of this guild.", + ); + } + }; + + // Start playing + let mut handler = handler_lock.lock().await; + let track_handle = handler.play_input(src.clone().into()); // TODO: Add event handlers + music_queue::set_now_playing_track_handle(guild_id, Some(track_handle)).await; + handler.add_global_event( + Event::Track(TrackEvent::End), + music_events::TrackEndNotifier { + guild_id: *guild_id, + channel_id: connect_to, + http: Arc::clone(&ctx.http), + cmdctx: Arc::new(ctx.clone()), + }, + ); + + Embed::create_yt_playing(src, username, "Now playing").await +} + +/// Play the provided song +pub async fn play_song(ctx: &Context, guild_id: &GuildId, target: &YoutubeDl) { + let manager = &songbird::get(ctx) // TODO match + .await + .expect("Cannot get Songbird.") + .clone(); + + if !user_util::is_self_connected_to_vc(ctx, guild_id).await { + println!("Bot is not connected to a VC, cannot play."); + return; + } + + music_queue::set_now_playing(guild_id, Some(target.clone())).await; + let handler_lock = match manager.get(*guild_id) { + Some(handler) => handler, + None => return, + }; + + let mut handler = handler_lock.lock().await; + handler.stop(); // Stop playing the current song + let track_handle = handler.play_input(target.clone().into()); // TODO: Add event handlers + music_queue::set_now_playing_track_handle(guild_id, Some(track_handle)).await; +} + +/// Attempt to skip the song, which is currently playing. Do nothing if there is no next song +pub async fn attempt_to_skip_current_song( + ctx: &Context, + guild_id: &GuildId, + user_id: &UserId, + username: &str, +) -> CreateEmbed { + if !user_util::is_user_connected_to_vc(ctx, guild_id, user_id).await { + return Embed::create_error_respose( + username, + "You are not connected to a VC", + "Connect to my vc to start controlling the music.", + ); + } + + let connect_to = match get_vc_id(ctx, guild_id, user_id).await { + Some(channel_id) => channel_id, + None => { + return Embed::create_error_respose(username, "Error", "Cannot find channel_id."); + } + }; + + let manager: &Arc = &songbird::get(ctx) // TODO match + .await + .expect("Cannot get Songbird.") + .clone(); + + let self_channel = user_util::get_self_vc_id(ctx, guild_id).await; + if !user_util::is_self_connected_to_vc(ctx, guild_id).await { + // self is connected to vc, check if user is in same vc + + if self_channel.is_none() { + // Connect to VC + manager // TODO match + .join(*guild_id, connect_to) + .await + .expect("Cannot connect>..."); } } else { let self_channel = self_channel.expect("Cannot get self channel"); // TODO: match @@ -81,181 +200,23 @@ pub async fn attempt_to_queue_song( } } - // Get query - let do_search = !query.starts_with("http"); - let search_query = if do_search { - match SearchEngines::YouTube.to_query(&query) { - Ok(x) => x, - Err(_) => { - return Embed::create_error_respose(username, "Cannot generate query", "Could not generate a seach query.."); - } - } - } else { // Allow piped links - query.to_string().replace("https://piped.moonleay.net/", "https://youtube.com/") - }; - - // Create source - let loaded_tracks = llc.load_tracks(guild_id.get(), &search_query).await.expect("Fuck."); - - let mut playlist_info = None; - - let tracks: Vec = match loaded_tracks.data { - Some(TrackLoadData::Track(x)) => vec![x.into()], - Some(TrackLoadData::Search(x)) => vec![x[0].clone().into()], - Some(TrackLoadData::Playlist(x)) => { - playlist_info = Some(x.info); - x.tracks.iter().map(|x| x.clone().into()).collect() - } - _ => { - return Embed::create_error_respose( - username, - "500: Server failure", - "Something went wrong when loading the track..."); - } - }; - - let mut response_title = ""; - let mut preview_data = None; - - if let Some(info) = playlist_info { - response_title = "Added playlist to queue"; - preview_data = Some(Preview { - title: info.name.to_string(), - artist: None, - duration: None, - thumbnail: None, - link: None, - }); - } else { - let track = tracks[0].track.clone(); - - response_title = "Added to queue"; - preview_data = Some(Preview { - title: track.info.title, - artist: Some(track.info.author), - duration: Some(track.info.length), - thumbnail: track.info.artwork_url, - link: track.info.uri - }); - } - - let player = match llc.get_player_context(guild_id.get()) { - Some(player) => player, - None => { - return Embed::create_error_respose(username, "Cannot get player", "Could not get player context."); - } - }; - - // let q = player.get_queue(); - // q.append(tracks.into()); - - let Ok(_) = player.play_now(&tracks[0].track).await else { - return Embed::create_error_respose(username, "Error playing", "Could not play track."); - }; - - // if let Ok(player_data) = player.get_player().await { - // if player_data.track.is_none() && q.get_track(0).await.is_ok_and(|x| x.is_some()) { - // player.skip(); - // } - // } - - - - Embed::create_playing(preview_data.unwrap(), username, &response_title).await -} - -/// Attempt to skip the song, which is currently playing. Do nothing if there is no next song -pub async fn attempt_to_skip_current_song( - ctx: &Context, - llc: &LavalinkClient, - guild_id: &GuildId, - user_id: &UserId, - username: &str, -) -> CreateEmbed { - if !user_util::is_user_connected_to_vc(ctx, guild_id, user_id).await { + let head = music_queue::next(guild_id).await; // TODO match + if head.is_none() { return Embed::create_error_respose( username, - "You are not connected to a VC", - "Connect to my vc to start controlling the music.", + "Cannot find a song to play", + "The queue is empty.", ); } + let head = head.unwrap(); + play_song(ctx, guild_id, &head).await; - let user_channel = match get_vc_id(ctx, guild_id, user_id).await { - Some(channel_id) => channel_id, - None => { - return Embed::create_error_respose(username, "Error", "Cannot find channel_id."); - } - }; - - let self_channel = user_util::get_self_vc_id(ctx, guild_id).await; - if !user_util::is_self_connected_to_vc(ctx, guild_id).await { - // Self is not connected to vc, cannot skip. - - return Embed::create_error_respose(username, "Not connected", "I am not connected and I am not playing anything, therefore you cannot skip."); - } else { - let self_channel = self_channel.expect("Cannot get self channel"); - - // Check if user is in the same VC as the bot - if self_channel != user_channel { - return Embed::create_error_respose( - username, - "You are not in my VC", - "You have to be in my VC in order to control the music.", - ); - } - } - - let Some(player_context) = llc.get_player_context(guild_id.get()) else { - return Embed::create_error_respose(username, "Not playing", "There is no player context and therefore there is nothing playing."); - }; - - let Ok(player) = player_context.get_player().await else { - return Embed::create_error_respose(username, "Can't get player", "Cannot get player from player context."); - }; - - - if let Some(_) = player.track { - let Ok(_) = player_context.skip() else { - return Embed::create_error_respose(username, "Cannot skip", "Could not skip track."); - }; - let ct = match player_context.get_player().await.expect("Can't get player").track { - Some(data) => data.info, - None => { // Disconnect - let songbird = songbird::get(ctx).await.unwrap().clone(); - - let Ok(_) = llc.delete_player(guild_id.get()).await else { - return Embed::create_error_respose(username, "Cannot delete player", "Could not delete player."); - }; - if songbird.get(GuildId::new(guild_id.get())).is_some() { - let Ok(_) = songbird.remove(GuildId::new(guild_id.get())).await else { - return Embed::create_error_respose(username, "Cannot remove ref", "Cannot remove songbird ref."); - }; - } - - return Embed::create_error_respose(username, "No track to skip to", "Therefore I am leaving the channel.") - } - }; - - let preview_data = Preview { - title: ct.title, - artist: Some(ct.author.to_string()), - duration: Some(ct.length), - thumbnail: ct.artwork_url, - link: ct.uri - }; - - return Embed::create_playing(preview_data, username, "Skipped; Now playing").await; - } - - return Embed::create_error_respose(username, "Not playing", "I'm currently not playing anything."); - - + Embed::create_yt_playing(head, username, "Song skipped; Now playing").await } /// Try to clear the queue and stop playing. Also leave the vc pub async fn attempt_to_stop( ctx: &Context, - llc: &LavalinkClient, guild_id: &GuildId, user_id: &UserId, username: &str, @@ -284,10 +245,7 @@ pub async fn attempt_to_stop( ); } - let player = llc.get_player_context(guild_id.get()).expect("Can't get player context."); - player.get_queue().clear(); - - let stopped = match leave(ctx, llc, guild_id).await { + let stopped = match leave(ctx, guild_id).await { Ok(stopped) => stopped, Err(e) => { println!("Error while stopping: {:?}", e); @@ -306,28 +264,26 @@ pub async fn attempt_to_stop( "I am not connected.\nI cant stop doing something, when I'm not doing it.", ) } else { + music_queue::delete_queue(guild_id).await; // Clear queue + Embed::create_success_response(username, "I stopped and left", "Just like you girlfriend.") } } /// Make the bot leave the voice channel. Returns Ok(true) if bot was connected, returns Ok(false) if bot was not connected. Returns Err if something went wrong. -pub async fn leave(ctx: &Context, llc: &LavalinkClient, guild_id: &GuildId) -> Result { - let Some(songbird) = songbird::get(ctx) - .await.clone() else { - return Err(JoinError::NoSender); - }; +pub async fn leave(ctx: &Context, guild_id: &GuildId) -> Result { + let manager = songbird::get(ctx) + .await + .expect("Cannot get Songbird") + .clone(); - if llc.get_player_context(guild_id.get()).is_some() { - let Ok(_) = llc.delete_player(guild_id.get()).await else { - return Err(JoinError::NoCall) - }; + let handler = manager.get(*guild_id); + let has_handler = handler.is_some(); + + if has_handler { + handler.unwrap().lock().await.stop(); + manager.remove(*guild_id).await?; + return Ok(true); // Handler removed } - - if songbird.get(GuildId::new(guild_id.get())).is_some() { - let Ok(_) = songbird.remove(GuildId::new(guild_id.get())).await else { - return Err(JoinError::Dropped); - }; - } - - return Ok(true) + Ok(false) // No handler, so it's already stopped } diff --git a/src/music/music_queue.rs b/src/music/music_queue.rs new file mode 100644 index 0000000..09a1cb9 --- /dev/null +++ b/src/music/music_queue.rs @@ -0,0 +1,84 @@ +use serenity::all::GuildId; +use songbird::input::YoutubeDl; +use songbird::tracks::TrackHandle; +use tokio::sync::Mutex; + +use std::collections::{HashMap, VecDeque}; +use std::sync::Arc; + +type MusicQueueItem = Arc>; + +#[derive(Debug)] +pub struct MusicQueue { + pub queue: VecDeque, + pub now_playing: Option, + pub now_playing_track_handle: Option, +} + +lazy_static! { + static ref HASHMAP: Mutex> = Mutex::new(HashMap::new()); +} + +async fn get_music_queue(guild_id: &GuildId) -> MusicQueueItem { + let mut queues = HASHMAP.lock().await; + + queues + .entry(*guild_id) + .or_insert(Arc::new(Mutex::new(MusicQueue { + queue: VecDeque::new(), + now_playing: None, + now_playing_track_handle: None, + }))) + .clone() +} + +pub async fn with_music_queue(guild_id: &GuildId, f: F) -> T +where + F: FnOnce(&mut MusicQueue) -> T, + T: Send, +{ + let queue = get_music_queue(guild_id).await; + let mut queue = queue.lock().await; + + f(&mut queue) +} + +pub async fn delete_queue(guild_id: &GuildId) { + with_music_queue(guild_id, |queue| { + queue.now_playing = None; + queue.queue.clear(); + }) + .await; +} + +pub async fn add_to_queue(guild_id: &GuildId, input: YoutubeDl) { + with_music_queue(guild_id, |queue| queue.queue.push_back(input)).await; +} + +/// Get next track in queue +pub async fn next(guild_id: &GuildId) -> Option { + with_music_queue(guild_id, |queue| queue.queue.pop_front()).await +} + +pub async fn set_now_playing(guild_id: &GuildId, now_playing: Option) { + with_music_queue(guild_id, |queue| queue.now_playing = now_playing).await; +} + +pub async fn get_now_playing(guild_id: &GuildId) -> Option { + with_music_queue(guild_id, |queue| queue.now_playing.to_owned()).await +} + +pub async fn set_now_playing_track_handle(guild_id: &GuildId, track_handle: Option) { + with_music_queue(guild_id, |queue| { + queue.now_playing_track_handle = track_handle + }) + .await +} + +pub async fn get_now_playing_track_handle(guild_id: &GuildId) -> Option { + with_music_queue(guild_id, |queue| queue.now_playing_track_handle.to_owned()).await +} + +pub async fn is_empty(guild_id: &GuildId) -> bool { + with_music_queue(guild_id, |queue| queue.queue.is_empty()).await +} diff --git a/src/music/preview.rs b/src/music/preview.rs deleted file mode 100644 index a5ffe9a..0000000 --- a/src/music/preview.rs +++ /dev/null @@ -1,7 +0,0 @@ -pub struct Preview { - pub title: String, - pub artist: Option, - pub duration: Option, - pub thumbnail: Option, - pub link: Option, -} \ No newline at end of file diff --git a/src/util/config.rs b/src/util/config.rs index a22568d..f5dc260 100644 --- a/src/util/config.rs +++ b/src/util/config.rs @@ -6,9 +6,6 @@ use std::error::Error; #[derive(Deserialize, Serialize)] pub struct Config { pub discord_token: String, - pub lavalink_address: String, - pub lavalink_password: String, - pub user_id: u64 } const CONFIG_FILE: &str = "./data/config.json"; @@ -26,9 +23,6 @@ pub fn load() -> Result> { fn create_empty() -> fs::File { let example_config = Config { discord_token: "paste_your_token".to_string(), - lavalink_address: "paste_your_lavalink_address".to_string(), - lavalink_password: "paste_your_lavalink_password".to_string(), - user_id: 976119987330777168 }; let mut config_file = fs::File::create(CONFIG_FILE).unwrap(); diff --git a/src/util/embed.rs b/src/util/embed.rs index 349fa11..39a0cbe 100644 --- a/src/util/embed.rs +++ b/src/util/embed.rs @@ -2,8 +2,7 @@ use std::time::Duration; use chrono::Local; use serenity::all::{Color, CreateEmbed, CreateEmbedAuthor, CreateEmbedFooter}; - -use crate::music::preview::Preview; +use songbird::input::{Compose, YoutubeDl}; pub struct Embed; @@ -39,21 +38,23 @@ impl Embed { ))) } - pub async fn create_playing( - preview: Preview, + pub async fn create_yt_playing( + mut src: YoutubeDl, username: &str, show_as_author: &str, ) -> CreateEmbed { let current_time = Local::now().format("%Y-%m-%d @ %H:%M:%S"); // Get metadata - let title = preview.title; - let artist = preview.artist.unwrap_or("t".to_string()); - let duration = Duration::from_millis(preview.duration.unwrap_or(0)); - let thumbnail = preview + let metadata = src.aux_metadata().await.expect("Cannot get metadata"); + let title = metadata.title.unwrap_or("Unknown title".to_string()); + let artist = metadata.artist.unwrap_or("Unknown artist".to_string()); + let duration = metadata.duration.unwrap_or(Duration::from_millis(0)); + let thumbnail = metadata .thumbnail .unwrap_or("https://http.cat/images/403.jpg".to_string()); - let link = preview.link + let link = metadata + .source_url .unwrap_or("https://piped.moonleay.net/403".to_string()); CreateEmbed::new()