mirror of
https://github.com/eRgo35/lyra.git
synced 2026-02-04 20:36:10 +01:00
Compare commits
9 Commits
78a1937210
...
0.10.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
10b7d4d7e3
|
|||
|
772d5d2a97
|
|||
|
f1b52d2be2
|
|||
|
e77818e09b
|
|||
|
5a026afc52
|
|||
|
8a0d08de4e
|
|||
|
f224ccfbdf
|
|||
|
d0af34833b
|
|||
|
c2e653b3ea
|
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,3 +1,3 @@
|
|||||||
/target
|
/target
|
||||||
|
**/target
|
||||||
.env
|
.env
|
||||||
|
|
||||||
|
|||||||
15
.gitmodules
vendored
15
.gitmodules
vendored
@@ -1,3 +1,12 @@
|
|||||||
[submodule "src/spotify-parser"]
|
[submodule "libs/songbird"]
|
||||||
path = src/spotify-parser
|
path = libs/songbird
|
||||||
url = https://github.com/eRgo35/spotify-parser
|
url = git@github.com:eRgo35/songbird.git
|
||||||
|
[submodule "libs/serenity"]
|
||||||
|
path = libs/serenity
|
||||||
|
url = git@github.com:eRgo35/serenity.git
|
||||||
|
[submodule "libs/poise"]
|
||||||
|
path = libs/poise
|
||||||
|
url = git@github.com:eRgo35/poise.git
|
||||||
|
[submodule "libs/spotify-parser"]
|
||||||
|
path = libs/spotify-parser
|
||||||
|
url = git@github.com:eRgo35/spotify-parser.git
|
||||||
|
|||||||
683
Cargo.lock
generated
683
Cargo.lock
generated
@@ -27,6 +27,19 @@ dependencies = [
|
|||||||
"generic-array",
|
"generic-array",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ahash"
|
||||||
|
version = "0.8.11"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011"
|
||||||
|
dependencies = [
|
||||||
|
"cfg-if",
|
||||||
|
"getrandom 0.2.15",
|
||||||
|
"once_cell",
|
||||||
|
"version_check",
|
||||||
|
"zerocopy 0.7.35",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "aho-corasick"
|
name = "aho-corasick"
|
||||||
version = "1.1.3"
|
version = "1.1.3"
|
||||||
@@ -71,6 +84,12 @@ dependencies = [
|
|||||||
"syn 2.0.72",
|
"syn 2.0.72",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "atomic-waker"
|
||||||
|
version = "1.1.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "audiopus"
|
name = "audiopus"
|
||||||
version = "0.3.0-rc.0"
|
version = "0.3.0-rc.0"
|
||||||
@@ -364,6 +383,29 @@ dependencies = [
|
|||||||
"zeroize",
|
"zeroize",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cssparser"
|
||||||
|
version = "0.31.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5b3df4f93e5fbbe73ec01ec8d3f68bba73107993a5b1e7519273c32db9b0d5be"
|
||||||
|
dependencies = [
|
||||||
|
"cssparser-macros",
|
||||||
|
"dtoa-short",
|
||||||
|
"itoa",
|
||||||
|
"phf 0.11.2",
|
||||||
|
"smallvec",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cssparser-macros"
|
||||||
|
version = "0.6.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331"
|
||||||
|
dependencies = [
|
||||||
|
"quote",
|
||||||
|
"syn 2.0.72",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "darling"
|
name = "darling"
|
||||||
version = "0.10.2"
|
version = "0.10.2"
|
||||||
@@ -539,6 +581,27 @@ version = "0.15.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f"
|
checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "dtoa"
|
||||||
|
version = "1.0.9"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "dtoa-short"
|
||||||
|
version = "0.3.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "cd1511a7b6a56299bd043a9c167a6d2bfb37bf84a6dfceaba651168adfb43c87"
|
||||||
|
dependencies = [
|
||||||
|
"dtoa",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ego-tree"
|
||||||
|
version = "0.6.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3a68a4904193147e0a8dec3314640e6db742afd5f6e634f428a6af230d9b3591"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "encoding_rs"
|
name = "encoding_rs"
|
||||||
version = "0.8.34"
|
version = "0.8.34"
|
||||||
@@ -657,6 +720,16 @@ dependencies = [
|
|||||||
"hashmap_derive",
|
"hashmap_derive",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "futf"
|
||||||
|
version = "0.1.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "df420e2e84819663797d1ec6544b13c5be84629e7bb00dc960d6917db2987843"
|
||||||
|
dependencies = [
|
||||||
|
"mac",
|
||||||
|
"new_debug_unreachable",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "futures"
|
name = "futures"
|
||||||
version = "0.3.30"
|
version = "0.3.30"
|
||||||
@@ -779,6 +852,15 @@ dependencies = [
|
|||||||
"zeroize",
|
"zeroize",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "getopts"
|
||||||
|
version = "0.2.21"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "14dbbfd5c71d70241ecf9e6f13737f7b5ce823821063188d7e46c41d371eebd5"
|
||||||
|
dependencies = [
|
||||||
|
"unicode-width",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "getrandom"
|
name = "getrandom"
|
||||||
version = "0.1.16"
|
version = "0.1.16"
|
||||||
@@ -834,6 +916,25 @@ dependencies = [
|
|||||||
"tracing",
|
"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]]
|
[[package]]
|
||||||
name = "hashbrown"
|
name = "hashbrown"
|
||||||
version = "0.14.5"
|
version = "0.14.5"
|
||||||
@@ -887,6 +988,20 @@ dependencies = [
|
|||||||
"thiserror",
|
"thiserror",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "html5ever"
|
||||||
|
version = "0.27.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c13771afe0e6e846f1e67d038d4cb29998a6779f93c809212e4e9c32efd244d4"
|
||||||
|
dependencies = [
|
||||||
|
"log",
|
||||||
|
"mac",
|
||||||
|
"markup5ever",
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn 2.0.72",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "http"
|
name = "http"
|
||||||
version = "0.2.12"
|
version = "0.2.12"
|
||||||
@@ -920,6 +1035,29 @@ dependencies = [
|
|||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "http-body"
|
||||||
|
version = "1.0.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184"
|
||||||
|
dependencies = [
|
||||||
|
"bytes",
|
||||||
|
"http 1.1.0",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "http-body-util"
|
||||||
|
version = "0.1.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f"
|
||||||
|
dependencies = [
|
||||||
|
"bytes",
|
||||||
|
"futures-util",
|
||||||
|
"http 1.1.0",
|
||||||
|
"http-body 1.0.1",
|
||||||
|
"pin-project-lite",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "httparse"
|
name = "httparse"
|
||||||
version = "1.9.4"
|
version = "1.9.4"
|
||||||
@@ -942,9 +1080,9 @@ dependencies = [
|
|||||||
"futures-channel",
|
"futures-channel",
|
||||||
"futures-core",
|
"futures-core",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"h2",
|
"h2 0.3.26",
|
||||||
"http 0.2.12",
|
"http 0.2.12",
|
||||||
"http-body",
|
"http-body 0.4.6",
|
||||||
"httparse",
|
"httparse",
|
||||||
"httpdate",
|
"httpdate",
|
||||||
"itoa",
|
"itoa",
|
||||||
@@ -956,6 +1094,26 @@ dependencies = [
|
|||||||
"want",
|
"want",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "hyper"
|
||||||
|
version = "1.4.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05"
|
||||||
|
dependencies = [
|
||||||
|
"bytes",
|
||||||
|
"futures-channel",
|
||||||
|
"futures-util",
|
||||||
|
"h2 0.4.5",
|
||||||
|
"http 1.1.0",
|
||||||
|
"http-body 1.0.1",
|
||||||
|
"httparse",
|
||||||
|
"itoa",
|
||||||
|
"pin-project-lite",
|
||||||
|
"smallvec",
|
||||||
|
"tokio",
|
||||||
|
"want",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hyper-rustls"
|
name = "hyper-rustls"
|
||||||
version = "0.24.2"
|
version = "0.24.2"
|
||||||
@@ -964,12 +1122,30 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"http 0.2.12",
|
"http 0.2.12",
|
||||||
"hyper",
|
"hyper 0.14.30",
|
||||||
"rustls 0.21.12",
|
"rustls 0.21.12",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-rustls 0.24.1",
|
"tokio-rustls 0.24.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "hyper-rustls"
|
||||||
|
version = "0.27.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155"
|
||||||
|
dependencies = [
|
||||||
|
"futures-util",
|
||||||
|
"http 1.1.0",
|
||||||
|
"hyper 1.4.1",
|
||||||
|
"hyper-util",
|
||||||
|
"rustls 0.23.12",
|
||||||
|
"rustls-pki-types",
|
||||||
|
"tokio",
|
||||||
|
"tokio-rustls 0.26.0",
|
||||||
|
"tower-service",
|
||||||
|
"webpki-roots 0.26.3",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hyper-tls"
|
name = "hyper-tls"
|
||||||
version = "0.5.0"
|
version = "0.5.0"
|
||||||
@@ -977,12 +1153,48 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905"
|
checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"hyper",
|
"hyper 0.14.30",
|
||||||
"native-tls",
|
"native-tls",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-native-tls",
|
"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.4.1",
|
||||||
|
"hyper-util",
|
||||||
|
"native-tls",
|
||||||
|
"tokio",
|
||||||
|
"tokio-native-tls",
|
||||||
|
"tower-service",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "hyper-util"
|
||||||
|
version = "0.1.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956"
|
||||||
|
dependencies = [
|
||||||
|
"bytes",
|
||||||
|
"futures-channel",
|
||||||
|
"futures-util",
|
||||||
|
"http 1.1.0",
|
||||||
|
"http-body 1.0.1",
|
||||||
|
"hyper 1.4.1",
|
||||||
|
"pin-project-lite",
|
||||||
|
"socket2",
|
||||||
|
"tokio",
|
||||||
|
"tower",
|
||||||
|
"tower-service",
|
||||||
|
"tracing",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iana-time-zone"
|
name = "iana-time-zone"
|
||||||
version = "0.1.60"
|
version = "0.1.60"
|
||||||
@@ -1080,6 +1292,18 @@ version = "1.0.5"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "db13adb97ab515a3691f56e4dbab09283d0b86cb45abd991d8634a9d6f501760"
|
checksum = "db13adb97ab515a3691f56e4dbab09283d0b86cb45abd991d8634a9d6f501760"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "lib-spotify-parser"
|
||||||
|
version = "1.0.0"
|
||||||
|
dependencies = [
|
||||||
|
"regex",
|
||||||
|
"reqwest 0.12.5",
|
||||||
|
"scraper",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"tokio",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.155"
|
version = "0.2.155"
|
||||||
@@ -1125,17 +1349,19 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lyra"
|
name = "lyra"
|
||||||
version = "0.8.2"
|
version = "0.10.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"dotenv",
|
"dotenv",
|
||||||
"fancy-regex",
|
"fancy-regex",
|
||||||
"json",
|
"json",
|
||||||
|
"lib-spotify-parser",
|
||||||
|
"once_cell",
|
||||||
"openssl",
|
"openssl",
|
||||||
"owoify",
|
"owoify",
|
||||||
"poise",
|
"poise",
|
||||||
"rand 0.8.5",
|
"rand 0.8.5",
|
||||||
"regex",
|
"regex",
|
||||||
"reqwest",
|
"reqwest 0.11.27",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"serenity",
|
"serenity",
|
||||||
@@ -1148,6 +1374,26 @@ dependencies = [
|
|||||||
"url",
|
"url",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "mac"
|
||||||
|
version = "0.1.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "markup5ever"
|
||||||
|
version = "0.12.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "16ce3abbeba692c8b8441d036ef91aea6df8da2c6b6e21c7e14d3c18e526be45"
|
||||||
|
dependencies = [
|
||||||
|
"log",
|
||||||
|
"phf 0.11.2",
|
||||||
|
"phf_codegen 0.11.2",
|
||||||
|
"string_cache",
|
||||||
|
"string_cache_codegen",
|
||||||
|
"tendril",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "matchers"
|
name = "matchers"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
@@ -1241,6 +1487,12 @@ dependencies = [
|
|||||||
"tempfile",
|
"tempfile",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "new_debug_unreachable"
|
||||||
|
version = "1.0.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "no-std-compat"
|
name = "no-std-compat"
|
||||||
version = "0.2.0"
|
version = "0.2.0"
|
||||||
@@ -1450,6 +1702,96 @@ version = "2.3.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
|
checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "phf"
|
||||||
|
version = "0.10.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259"
|
||||||
|
dependencies = [
|
||||||
|
"phf_shared 0.10.0",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "phf"
|
||||||
|
version = "0.11.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc"
|
||||||
|
dependencies = [
|
||||||
|
"phf_macros",
|
||||||
|
"phf_shared 0.11.2",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "phf_codegen"
|
||||||
|
version = "0.10.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "4fb1c3a8bc4dd4e5cfce29b44ffc14bedd2ee294559a294e2a4d4c9e9a6a13cd"
|
||||||
|
dependencies = [
|
||||||
|
"phf_generator 0.10.0",
|
||||||
|
"phf_shared 0.10.0",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "phf_codegen"
|
||||||
|
version = "0.11.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e8d39688d359e6b34654d328e262234662d16cc0f60ec8dcbe5e718709342a5a"
|
||||||
|
dependencies = [
|
||||||
|
"phf_generator 0.11.2",
|
||||||
|
"phf_shared 0.11.2",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "phf_generator"
|
||||||
|
version = "0.10.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6"
|
||||||
|
dependencies = [
|
||||||
|
"phf_shared 0.10.0",
|
||||||
|
"rand 0.8.5",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "phf_generator"
|
||||||
|
version = "0.11.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0"
|
||||||
|
dependencies = [
|
||||||
|
"phf_shared 0.11.2",
|
||||||
|
"rand 0.8.5",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "phf_macros"
|
||||||
|
version = "0.11.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b"
|
||||||
|
dependencies = [
|
||||||
|
"phf_generator 0.11.2",
|
||||||
|
"phf_shared 0.11.2",
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn 2.0.72",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "phf_shared"
|
||||||
|
version = "0.10.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096"
|
||||||
|
dependencies = [
|
||||||
|
"siphasher",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "phf_shared"
|
||||||
|
version = "0.11.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b"
|
||||||
|
dependencies = [
|
||||||
|
"siphasher",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pin-project"
|
name = "pin-project"
|
||||||
version = "1.1.5"
|
version = "1.1.5"
|
||||||
@@ -1570,9 +1912,15 @@ version = "0.2.18"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "dee4364d9f3b902ef14fab8a1ddffb783a1cb6b4bba3bfc1fa3922732c7de97f"
|
checksum = "dee4364d9f3b902ef14fab8a1ddffb783a1cb6b4bba3bfc1fa3922732c7de97f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"zerocopy",
|
"zerocopy 0.6.6",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "precomputed-hash"
|
||||||
|
version = "0.1.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "primal-check"
|
name = "primal-check"
|
||||||
version = "0.3.4"
|
version = "0.3.4"
|
||||||
@@ -1602,6 +1950,52 @@ dependencies = [
|
|||||||
"unicase",
|
"unicase",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "quinn"
|
||||||
|
version = "0.11.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad"
|
||||||
|
dependencies = [
|
||||||
|
"bytes",
|
||||||
|
"pin-project-lite",
|
||||||
|
"quinn-proto",
|
||||||
|
"quinn-udp",
|
||||||
|
"rustc-hash",
|
||||||
|
"rustls 0.23.12",
|
||||||
|
"thiserror",
|
||||||
|
"tokio",
|
||||||
|
"tracing",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "quinn-proto"
|
||||||
|
version = "0.11.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe"
|
||||||
|
dependencies = [
|
||||||
|
"bytes",
|
||||||
|
"rand 0.8.5",
|
||||||
|
"ring 0.17.8",
|
||||||
|
"rustc-hash",
|
||||||
|
"rustls 0.23.12",
|
||||||
|
"slab",
|
||||||
|
"thiserror",
|
||||||
|
"tinyvec",
|
||||||
|
"tracing",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "quinn-udp"
|
||||||
|
version = "0.5.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285"
|
||||||
|
dependencies = [
|
||||||
|
"libc",
|
||||||
|
"once_cell",
|
||||||
|
"socket2",
|
||||||
|
"windows-sys 0.52.0",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "quote"
|
name = "quote"
|
||||||
version = "1.0.36"
|
version = "1.0.36"
|
||||||
@@ -1755,12 +2149,12 @@ dependencies = [
|
|||||||
"encoding_rs",
|
"encoding_rs",
|
||||||
"futures-core",
|
"futures-core",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"h2",
|
"h2 0.3.26",
|
||||||
"http 0.2.12",
|
"http 0.2.12",
|
||||||
"http-body",
|
"http-body 0.4.6",
|
||||||
"hyper",
|
"hyper 0.14.30",
|
||||||
"hyper-rustls",
|
"hyper-rustls 0.24.2",
|
||||||
"hyper-tls",
|
"hyper-tls 0.5.0",
|
||||||
"ipnet",
|
"ipnet",
|
||||||
"js-sys",
|
"js-sys",
|
||||||
"log",
|
"log",
|
||||||
@@ -1771,11 +2165,11 @@ dependencies = [
|
|||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
"rustls 0.21.12",
|
"rustls 0.21.12",
|
||||||
"rustls-pemfile",
|
"rustls-pemfile 1.0.4",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"serde_urlencoded",
|
"serde_urlencoded",
|
||||||
"sync_wrapper",
|
"sync_wrapper 0.1.2",
|
||||||
"system-configuration",
|
"system-configuration",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-native-tls",
|
"tokio-native-tls",
|
||||||
@@ -1788,7 +2182,56 @@ dependencies = [
|
|||||||
"wasm-streams",
|
"wasm-streams",
|
||||||
"web-sys",
|
"web-sys",
|
||||||
"webpki-roots 0.25.4",
|
"webpki-roots 0.25.4",
|
||||||
"winreg",
|
"winreg 0.50.0",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "reqwest"
|
||||||
|
version = "0.12.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37"
|
||||||
|
dependencies = [
|
||||||
|
"base64 0.22.1",
|
||||||
|
"bytes",
|
||||||
|
"encoding_rs",
|
||||||
|
"futures-channel",
|
||||||
|
"futures-core",
|
||||||
|
"futures-util",
|
||||||
|
"h2 0.4.5",
|
||||||
|
"http 1.1.0",
|
||||||
|
"http-body 1.0.1",
|
||||||
|
"http-body-util",
|
||||||
|
"hyper 1.4.1",
|
||||||
|
"hyper-rustls 0.27.2",
|
||||||
|
"hyper-tls 0.6.0",
|
||||||
|
"hyper-util",
|
||||||
|
"ipnet",
|
||||||
|
"js-sys",
|
||||||
|
"log",
|
||||||
|
"mime",
|
||||||
|
"native-tls",
|
||||||
|
"once_cell",
|
||||||
|
"percent-encoding",
|
||||||
|
"pin-project-lite",
|
||||||
|
"quinn",
|
||||||
|
"rustls 0.23.12",
|
||||||
|
"rustls-pemfile 2.1.2",
|
||||||
|
"rustls-pki-types",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"serde_urlencoded",
|
||||||
|
"sync_wrapper 1.0.1",
|
||||||
|
"system-configuration",
|
||||||
|
"tokio",
|
||||||
|
"tokio-native-tls",
|
||||||
|
"tokio-rustls 0.26.0",
|
||||||
|
"tower-service",
|
||||||
|
"url",
|
||||||
|
"wasm-bindgen",
|
||||||
|
"wasm-bindgen-futures",
|
||||||
|
"web-sys",
|
||||||
|
"webpki-roots 0.26.3",
|
||||||
|
"winreg 0.52.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -1848,6 +2291,12 @@ version = "0.1.24"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f"
|
checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rustc-hash"
|
||||||
|
version = "1.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustc_version"
|
name = "rustc_version"
|
||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
@@ -1923,6 +2372,20 @@ dependencies = [
|
|||||||
"zeroize",
|
"zeroize",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rustls"
|
||||||
|
version = "0.23.12"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044"
|
||||||
|
dependencies = [
|
||||||
|
"once_cell",
|
||||||
|
"ring 0.17.8",
|
||||||
|
"rustls-pki-types",
|
||||||
|
"rustls-webpki 0.102.6",
|
||||||
|
"subtle",
|
||||||
|
"zeroize",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustls-native-certs"
|
name = "rustls-native-certs"
|
||||||
version = "0.6.3"
|
version = "0.6.3"
|
||||||
@@ -1930,7 +2393,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00"
|
checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"openssl-probe",
|
"openssl-probe",
|
||||||
"rustls-pemfile",
|
"rustls-pemfile 1.0.4",
|
||||||
"schannel",
|
"schannel",
|
||||||
"security-framework",
|
"security-framework",
|
||||||
]
|
]
|
||||||
@@ -1944,6 +2407,16 @@ dependencies = [
|
|||||||
"base64 0.21.7",
|
"base64 0.21.7",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rustls-pemfile"
|
||||||
|
version = "2.1.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d"
|
||||||
|
dependencies = [
|
||||||
|
"base64 0.22.1",
|
||||||
|
"rustls-pki-types",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustls-pki-types"
|
name = "rustls-pki-types"
|
||||||
version = "1.7.0"
|
version = "1.7.0"
|
||||||
@@ -2035,6 +2508,22 @@ version = "1.2.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
|
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "scraper"
|
||||||
|
version = "0.19.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "761fb705fdf625482d2ed91d3f0559dcfeab2798fe2771c69560a774865d0802"
|
||||||
|
dependencies = [
|
||||||
|
"ahash",
|
||||||
|
"cssparser",
|
||||||
|
"ego-tree",
|
||||||
|
"getopts",
|
||||||
|
"html5ever",
|
||||||
|
"once_cell",
|
||||||
|
"selectors",
|
||||||
|
"tendril",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sct"
|
name = "sct"
|
||||||
version = "0.7.1"
|
version = "0.7.1"
|
||||||
@@ -2078,6 +2567,25 @@ dependencies = [
|
|||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "selectors"
|
||||||
|
version = "0.25.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "4eb30575f3638fc8f6815f448d50cb1a2e255b0897985c8c59f4d37b72a07b06"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags 2.6.0",
|
||||||
|
"cssparser",
|
||||||
|
"derive_more",
|
||||||
|
"fxhash",
|
||||||
|
"log",
|
||||||
|
"new_debug_unreachable",
|
||||||
|
"phf 0.10.1",
|
||||||
|
"phf_codegen 0.10.0",
|
||||||
|
"precomputed-hash",
|
||||||
|
"servo_arc",
|
||||||
|
"smallvec",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "semver"
|
name = "semver"
|
||||||
version = "1.0.23"
|
version = "1.0.23"
|
||||||
@@ -2193,7 +2701,7 @@ dependencies = [
|
|||||||
"mime_guess",
|
"mime_guess",
|
||||||
"parking_lot",
|
"parking_lot",
|
||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
"reqwest",
|
"reqwest 0.11.27",
|
||||||
"secrecy",
|
"secrecy",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_cow",
|
"serde_cow",
|
||||||
@@ -2212,8 +2720,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "serenity-voice-model"
|
name = "serenity-voice-model"
|
||||||
version = "0.2.0"
|
version = "0.2.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "git+https://github.com/serenity-rs/serenity?branch=current#658b6a7261fbde7cf59f84613f870ef7a48735c6"
|
||||||
checksum = "593682f6155d07c8b331b3d1060f5aab7e6796caca9f2f66bd9e6855c880e06b"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.6.0",
|
"bitflags 2.6.0",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
@@ -2222,6 +2729,15 @@ dependencies = [
|
|||||||
"serde_repr",
|
"serde_repr",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "servo_arc"
|
||||||
|
version = "0.3.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d036d71a959e00c77a63538b90a6c2390969f9772b096ea837205c6bd0491a44"
|
||||||
|
dependencies = [
|
||||||
|
"stable_deref_trait",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sha1"
|
name = "sha1"
|
||||||
version = "0.10.6"
|
version = "0.10.6"
|
||||||
@@ -2263,6 +2779,12 @@ dependencies = [
|
|||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "siphasher"
|
||||||
|
version = "0.3.11"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "skeptic"
|
name = "skeptic"
|
||||||
version = "0.13.7"
|
version = "0.13.7"
|
||||||
@@ -2324,7 +2846,7 @@ dependencies = [
|
|||||||
"parking_lot",
|
"parking_lot",
|
||||||
"pin-project",
|
"pin-project",
|
||||||
"rand 0.8.5",
|
"rand 0.8.5",
|
||||||
"reqwest",
|
"reqwest 0.11.27",
|
||||||
"ringbuf",
|
"ringbuf",
|
||||||
"rubato",
|
"rubato",
|
||||||
"rusty_pool",
|
"rusty_pool",
|
||||||
@@ -2373,6 +2895,12 @@ dependencies = [
|
|||||||
"no-std-compat",
|
"no-std-compat",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "stable_deref_trait"
|
||||||
|
version = "1.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "static_assertions"
|
name = "static_assertions"
|
||||||
version = "1.1.0"
|
version = "1.1.0"
|
||||||
@@ -2390,7 +2918,7 @@ dependencies = [
|
|||||||
"futures-util",
|
"futures-util",
|
||||||
"hls_m3u8",
|
"hls_m3u8",
|
||||||
"patricia_tree",
|
"patricia_tree",
|
||||||
"reqwest",
|
"reqwest 0.11.27",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tracing",
|
"tracing",
|
||||||
"url",
|
"url",
|
||||||
@@ -2413,6 +2941,32 @@ version = "0.2.4"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fe895eb47f22e2ddd4dabc02bce419d2e643c8e3b585c78158b349195bc24d82"
|
checksum = "fe895eb47f22e2ddd4dabc02bce419d2e643c8e3b585c78158b349195bc24d82"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "string_cache"
|
||||||
|
version = "0.8.7"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b"
|
||||||
|
dependencies = [
|
||||||
|
"new_debug_unreachable",
|
||||||
|
"once_cell",
|
||||||
|
"parking_lot",
|
||||||
|
"phf_shared 0.10.0",
|
||||||
|
"precomputed-hash",
|
||||||
|
"serde",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "string_cache_codegen"
|
||||||
|
version = "0.5.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6bb30289b722be4ff74a408c3cc27edeaad656e06cb1fe8fa9231fa59c728988"
|
||||||
|
dependencies = [
|
||||||
|
"phf_generator 0.10.0",
|
||||||
|
"phf_shared 0.10.0",
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "strsim"
|
name = "strsim"
|
||||||
version = "0.9.3"
|
version = "0.9.3"
|
||||||
@@ -2663,6 +3217,12 @@ version = "0.1.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160"
|
checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sync_wrapper"
|
||||||
|
version = "1.0.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "system-configuration"
|
name = "system-configuration"
|
||||||
version = "0.5.1"
|
version = "0.5.1"
|
||||||
@@ -2703,6 +3263,17 @@ dependencies = [
|
|||||||
"windows-sys 0.52.0",
|
"windows-sys 0.52.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tendril"
|
||||||
|
version = "0.4.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d24a120c5fc464a3458240ee02c299ebcb9d67b5249c8848b09d639dca8d7bb0"
|
||||||
|
dependencies = [
|
||||||
|
"futf",
|
||||||
|
"mac",
|
||||||
|
"utf-8",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "thiserror"
|
name = "thiserror"
|
||||||
version = "1.0.63"
|
version = "1.0.63"
|
||||||
@@ -2850,6 +3421,17 @@ dependencies = [
|
|||||||
"tokio",
|
"tokio",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tokio-rustls"
|
||||||
|
version = "0.26.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4"
|
||||||
|
dependencies = [
|
||||||
|
"rustls 0.23.12",
|
||||||
|
"rustls-pki-types",
|
||||||
|
"tokio",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tokio-tungstenite"
|
name = "tokio-tungstenite"
|
||||||
version = "0.18.0"
|
version = "0.18.0"
|
||||||
@@ -2895,6 +3477,27 @@ dependencies = [
|
|||||||
"tokio",
|
"tokio",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[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",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tower-layer"
|
||||||
|
version = "0.3.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tower-service"
|
name = "tower-service"
|
||||||
version = "0.3.2"
|
version = "0.3.2"
|
||||||
@@ -3157,6 +3760,12 @@ version = "1.11.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202"
|
checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unicode-width"
|
||||||
|
version = "0.1.13"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "universal-hash"
|
name = "universal-hash"
|
||||||
version = "0.5.1"
|
version = "0.5.1"
|
||||||
@@ -3582,6 +4191,16 @@ dependencies = [
|
|||||||
"windows-sys 0.48.0",
|
"windows-sys 0.48.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "winreg"
|
||||||
|
version = "0.52.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5"
|
||||||
|
dependencies = [
|
||||||
|
"cfg-if",
|
||||||
|
"windows-sys 0.48.0",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zerocopy"
|
name = "zerocopy"
|
||||||
version = "0.6.6"
|
version = "0.6.6"
|
||||||
@@ -3589,7 +4208,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "854e949ac82d619ee9a14c66a1b674ac730422372ccb759ce0c39cabcf2bf8e6"
|
checksum = "854e949ac82d619ee9a14c66a1b674ac730422372ccb759ce0c39cabcf2bf8e6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"zerocopy-derive",
|
"zerocopy-derive 0.6.6",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "zerocopy"
|
||||||
|
version = "0.7.35"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0"
|
||||||
|
dependencies = [
|
||||||
|
"zerocopy-derive 0.7.35",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -3603,6 +4231,17 @@ dependencies = [
|
|||||||
"syn 2.0.72",
|
"syn 2.0.72",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[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.72",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zeroize"
|
name = "zeroize"
|
||||||
version = "1.8.1"
|
version = "1.8.1"
|
||||||
|
|||||||
22
Cargo.toml
22
Cargo.toml
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "lyra"
|
name = "lyra"
|
||||||
version = "0.8.2"
|
version = "0.10.0"
|
||||||
authors = ["Michał Czyż <mike@c2yz.com>"]
|
authors = ["Michał Czyż <mike@c2yz.com>"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "A featureful Discord bot written in Rust."
|
description = "A featureful Discord bot written in Rust."
|
||||||
@@ -10,26 +10,31 @@ homepage = "https://lyra.c2yz.com"
|
|||||||
license-file = "LICENSE.md"
|
license-file = "LICENSE.md"
|
||||||
keywords = ["discord", "bot", "rust", "music", "featureful"]
|
keywords = ["discord", "bot", "rust", "music", "featureful"]
|
||||||
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
lib-spotify-parser = { path = "./libs/spotify-parser" }
|
||||||
dotenv = "0.15.0"
|
dotenv = "0.15.0"
|
||||||
fancy-regex = "0.13.0"
|
fancy-regex = "0.13.0"
|
||||||
json = "0.12.4"
|
json = "0.12.4"
|
||||||
openssl = { version = "0.10.66", features = ["vendored"] }
|
openssl = { version = "0.10.66", features = ["vendored"] }
|
||||||
owoify = "0.1.5"
|
owoify = "0.1.5"
|
||||||
poise = "0.6.1"
|
poise = { default-features = true, version = "0.6.1" }
|
||||||
rand = "0.8.5"
|
rand = "0.8.5"
|
||||||
regex = "1.10.6"
|
regex = "1.10.6"
|
||||||
reqwest = { version = "0.11.27", features = ["json"] }
|
reqwest = { version = "0.11.27", features = ["json"] }
|
||||||
serde = { version = "1.0.204", features = ["derive"] }
|
serde = { version = "1.0.204", features = ["derive"] }
|
||||||
serde_json = "1.0.122"
|
serde_json = "1.0.122"
|
||||||
serenity = { version = "0.12.2", features = [
|
songbird = { version = "0.4.3", default-features = true, features = [
|
||||||
|
"builtin-queue",
|
||||||
|
] }
|
||||||
|
serenity = { default-features = true, features = [
|
||||||
"cache",
|
"cache",
|
||||||
"framework",
|
"framework",
|
||||||
"standard_framework",
|
"standard_framework",
|
||||||
"voice",
|
"voice",
|
||||||
] }
|
"http",
|
||||||
songbird = { version = "0.4.3", features = ["builtin-queue", "serenity"] }
|
"rustls_backend",
|
||||||
|
], version = "0.12" }
|
||||||
|
|
||||||
symphonia = { version = "0.5.4", features = [
|
symphonia = { version = "0.5.4", features = [
|
||||||
"aac",
|
"aac",
|
||||||
"adpcm",
|
"adpcm",
|
||||||
@@ -43,3 +48,8 @@ tracing = "0.1.40"
|
|||||||
tracing-futures = "0.2.5"
|
tracing-futures = "0.2.5"
|
||||||
tracing-subscriber = "0.3.18"
|
tracing-subscriber = "0.3.18"
|
||||||
url = "2.5.2"
|
url = "2.5.2"
|
||||||
|
once_cell = "1.19.0"
|
||||||
|
|
||||||
|
[patch.crates-io.serenity-voice-model]
|
||||||
|
git = "https://github.com/serenity-rs/serenity"
|
||||||
|
branch = "current"
|
||||||
|
|||||||
BIN
assets/lyra-nightly.png
Normal file
BIN
assets/lyra-nightly.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 291 KiB |
1
libs/poise
Submodule
1
libs/poise
Submodule
Submodule libs/poise added at 575025909b
1
libs/serenity
Submodule
1
libs/serenity
Submodule
Submodule libs/serenity added at 658b6a7261
1
libs/songbird
Submodule
1
libs/songbird
Submodule
Submodule libs/songbird added at 2d7dc29fd6
1
libs/spotify-parser
Submodule
1
libs/spotify-parser
Submodule
Submodule libs/spotify-parser added at 4398512b5c
@@ -1,4 +1,3 @@
|
|||||||
pub mod embeds;
|
pub mod embeds;
|
||||||
pub mod kashi;
|
|
||||||
pub mod music;
|
pub mod music;
|
||||||
pub mod tools;
|
pub mod tools;
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
use crate::{Context, Error};
|
use crate::{Context, Error};
|
||||||
|
|
||||||
use poise::serenity_prelude::CreateEmbed;
|
use poise::serenity_prelude::{
|
||||||
use poise::CreateReply;
|
Color, CreateEmbed, CreateEmbedAuthor, CreateEmbedFooter, Timestamp,
|
||||||
use serenity::{
|
|
||||||
builder::{CreateEmbedAuthor, CreateEmbedFooter},
|
|
||||||
model::{Colour, Timestamp},
|
|
||||||
};
|
};
|
||||||
|
use poise::CreateReply;
|
||||||
|
|
||||||
pub async fn fail(ctx: Context<'_>, err: String) -> Result<(), Error> {
|
pub async fn fail(ctx: Context<'_>, err: String) -> Result<(), Error> {
|
||||||
ctx.send(
|
ctx.send(
|
||||||
@@ -25,7 +23,7 @@ pub async fn error_embed(ctx: Context<'_>, msg: &str) -> Result<CreateEmbed, Err
|
|||||||
.author(
|
.author(
|
||||||
CreateEmbedAuthor::new("Something went wrong!").icon_url(ctx.author().clone().face()),
|
CreateEmbedAuthor::new("Something went wrong!").icon_url(ctx.author().clone().face()),
|
||||||
)
|
)
|
||||||
.colour(Colour::from_rgb(255, 58, 97))
|
.colour(Color::from_rgb(255, 58, 97))
|
||||||
.title("Oopsie, Doopsie!")
|
.title("Oopsie, Doopsie!")
|
||||||
.description(msg)
|
.description(msg)
|
||||||
.timestamp(Timestamp::now())
|
.timestamp(Timestamp::now())
|
||||||
@@ -45,7 +43,7 @@ pub async fn embed(
|
|||||||
) -> Result<CreateEmbed, Error> {
|
) -> Result<CreateEmbed, Error> {
|
||||||
let embed = CreateEmbed::default()
|
let embed = CreateEmbed::default()
|
||||||
.author(CreateEmbedAuthor::new(author).icon_url(ctx.author().clone().face()))
|
.author(CreateEmbedAuthor::new(author).icon_url(ctx.author().clone().face()))
|
||||||
.colour(Colour::from_rgb(255, 58, 97))
|
.colour(Color::from_rgb(255, 58, 97))
|
||||||
.title(title)
|
.title(title)
|
||||||
.description(description)
|
.description(description)
|
||||||
.timestamp(Timestamp::now())
|
.timestamp(Timestamp::now())
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
pub mod kashi;
|
|
||||||
|
|
||||||
pub use kashi::kashi;
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
use crate::{Context, Error};
|
|
||||||
|
|
||||||
/// Kashi integration platform (WIP)
|
|
||||||
#[poise::command(
|
|
||||||
prefix_command,
|
|
||||||
slash_command,
|
|
||||||
category = "Kashi"
|
|
||||||
)]
|
|
||||||
pub async fn kashi(
|
|
||||||
ctx: Context<'_>
|
|
||||||
) -> Result<(), Error> {
|
|
||||||
|
|
||||||
let response = format!("Kashi platform is currently under construction!");
|
|
||||||
ctx.say(response).await?;
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
@@ -15,7 +15,7 @@ use poise::CreateReply;
|
|||||||
pub async fn deafen(ctx: Context<'_>) -> Result<(), Error> {
|
pub async fn deafen(ctx: Context<'_>) -> Result<(), Error> {
|
||||||
let guild_id = ctx.guild_id().unwrap();
|
let guild_id = ctx.guild_id().unwrap();
|
||||||
|
|
||||||
let manager = songbird::get(&ctx.serenity_context())
|
let manager = songbird::get(ctx.serenity_context())
|
||||||
.await
|
.await
|
||||||
.expect("Songbird client placed at init")
|
.expect("Songbird client placed at init")
|
||||||
.clone();
|
.clone();
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ pub async fn join(ctx: Context<'_>) -> Result<(), Error> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let manager = songbird::get(&ctx.serenity_context())
|
let manager = songbird::get(ctx.serenity_context())
|
||||||
.await
|
.await
|
||||||
.expect("Songbird client placed at init")
|
.expect("Songbird client placed at init")
|
||||||
.clone();
|
.clone();
|
||||||
|
|||||||
@@ -15,12 +15,12 @@ use poise::CreateReply;
|
|||||||
pub async fn leave(ctx: Context<'_>) -> Result<(), Error> {
|
pub async fn leave(ctx: Context<'_>) -> Result<(), Error> {
|
||||||
let guild_id = ctx.guild_id().unwrap();
|
let guild_id = ctx.guild_id().unwrap();
|
||||||
|
|
||||||
let manager = songbird::get(&ctx.serenity_context())
|
let manager = songbird::get(ctx.serenity_context())
|
||||||
.await
|
.await
|
||||||
.expect("Songbird client placed at init")
|
.expect("Songbird client placed at init")
|
||||||
.clone();
|
.clone();
|
||||||
|
|
||||||
if !manager.get(guild_id).is_some() {
|
if manager.get(guild_id).is_none() {
|
||||||
let msg = "I am not in a voice channel!";
|
let msg = "I am not in a voice channel!";
|
||||||
ctx.send(CreateReply::default().embed(error_embed(ctx, msg).await.unwrap()))
|
ctx.send(CreateReply::default().embed(error_embed(ctx, msg).await.unwrap()))
|
||||||
.await?;
|
.await?;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ use poise::CreateReply;
|
|||||||
pub async fn mute(ctx: Context<'_>) -> Result<(), Error> {
|
pub async fn mute(ctx: Context<'_>) -> Result<(), Error> {
|
||||||
let guild_id = ctx.guild_id().unwrap();
|
let guild_id = ctx.guild_id().unwrap();
|
||||||
|
|
||||||
let manager = songbird::get(&ctx.serenity_context())
|
let manager = songbird::get(ctx.serenity_context())
|
||||||
.await
|
.await
|
||||||
.expect("Songbird client placed at init")
|
.expect("Songbird client placed at init")
|
||||||
.clone();
|
.clone();
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ use poise::CreateReply;
|
|||||||
pub async fn pause(ctx: Context<'_>) -> Result<(), Error> {
|
pub async fn pause(ctx: Context<'_>) -> Result<(), Error> {
|
||||||
let guild_id = ctx.guild_id().unwrap();
|
let guild_id = ctx.guild_id().unwrap();
|
||||||
|
|
||||||
let manager = songbird::get(&ctx.serenity_context())
|
let manager = songbird::get(ctx.serenity_context())
|
||||||
.await
|
.await
|
||||||
.expect("Songbird client placed at init")
|
.expect("Songbird client placed at init")
|
||||||
.clone();
|
.clone();
|
||||||
|
|||||||
@@ -1,24 +1,24 @@
|
|||||||
use crate::commands::music::metadata::Metadata;
|
use crate::commands::music::metadata::Metadata;
|
||||||
|
use crate::commands::music::notifier::TrackErrorNotifier;
|
||||||
use crate::{commands::embeds::error_embed, Context, Error};
|
use crate::{commands::embeds::error_embed, Context, Error};
|
||||||
|
|
||||||
use fancy_regex::Regex;
|
use lib_spotify_parser;
|
||||||
use poise::serenity_prelude::model::Timestamp;
|
use poise::serenity_prelude::{
|
||||||
use poise::serenity_prelude::Colour;
|
Color, CreateEmbed, CreateEmbedAuthor, CreateEmbedFooter, Timestamp,
|
||||||
use poise::serenity_prelude::CreateEmbed;
|
};
|
||||||
use poise::CreateReply;
|
use poise::CreateReply;
|
||||||
use regex::Regex as Regex_Classic;
|
use regex::Regex as Regex_Classic;
|
||||||
use serenity::builder::CreateEmbedAuthor;
|
use reqwest::Client;
|
||||||
use serenity::builder::CreateEmbedFooter;
|
use serenity::all::GuildId;
|
||||||
use songbird::events::TrackEvent;
|
use songbird::events::TrackEvent;
|
||||||
use songbird::input::AuxMetadata;
|
use songbird::input::AuxMetadata;
|
||||||
use songbird::input::{Compose, YoutubeDl};
|
use songbird::input::{Compose, YoutubeDl};
|
||||||
use songbird::tracks::{TrackHandle, TrackQueue};
|
use songbird::tracks::TrackQueue;
|
||||||
|
use songbird::Call;
|
||||||
|
use std::collections::VecDeque;
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
use crate::commands::music::notifier::TrackErrorNotifier;
|
|
||||||
use crate::http::HttpKey;
|
|
||||||
|
|
||||||
/// Plays a song; \
|
/// Plays a song; \
|
||||||
/// you can search by query or paste an url; \
|
/// you can search by query or paste an url; \
|
||||||
/// aliases: play, p, enqueue
|
/// aliases: play, p, enqueue
|
||||||
@@ -32,161 +32,151 @@ pub async fn play(
|
|||||||
ctx: Context<'_>,
|
ctx: Context<'_>,
|
||||||
#[description = "Provide a query or an url"]
|
#[description = "Provide a query or an url"]
|
||||||
#[rest]
|
#[rest]
|
||||||
mut song: String,
|
song: String,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
let regex_spotify = Regex::new(r"https?:\/\/(?:embed\.|open\.)(?:spotify\.com\/)(?:track\/|\?uri=spotify:track:)((\w|-)+)(?:(?=\?)(?:[?&]foo=(\d*)(?=[&#]|$)|(?![?&]foo=)[^#])+)?(?=#|$)").unwrap();
|
|
||||||
let regex_youtube =
|
|
||||||
Regex_Classic::new(r#""url": "(https://www.youtube.com/watch\?v=[A-Za-z0-9]{11})""#)
|
|
||||||
.unwrap();
|
|
||||||
let regex_youtube_playlist = Regex::new(
|
|
||||||
r"^((?:https?:)\/\/)?((?:www|m)\.)?((?:youtube\.com)).*(youtu.be\/|list=)([^#&?]*).*",
|
|
||||||
)
|
|
||||||
.unwrap();
|
|
||||||
let regex_spotify_playlist = Regex::new(r"https?:\/\/(?:embed\.|open\.)(?:spotify\.com\/)(?:(album|playlist)\/|\?uri=spotify:playlist:)((\w|-)+)(?:(?=\?)(?:[?&]foo=(\d*)(?=[&#]|$)|(?![?&]foo=)[^#])+)?(?=#|$)").unwrap();
|
|
||||||
|
|
||||||
let is_playlist = regex_youtube_playlist.is_match(&song).unwrap()
|
|
||||||
|| regex_spotify_playlist.is_match(&song).unwrap();
|
|
||||||
let is_spotify =
|
|
||||||
regex_spotify.is_match(&song).unwrap() || regex_spotify_playlist.is_match(&song).unwrap();
|
|
||||||
let is_query = !song.starts_with("http");
|
|
||||||
|
|
||||||
let guild_id = ctx.guild_id().unwrap();
|
let guild_id = ctx.guild_id().unwrap();
|
||||||
let channel_id = ctx
|
let http_client = ctx.data().http_client.clone();
|
||||||
.guild()
|
let manager = songbird::get(ctx.serenity_context()).await.unwrap().clone();
|
||||||
.unwrap()
|
|
||||||
.voice_states
|
|
||||||
.get(&ctx.author().id)
|
|
||||||
.and_then(|voice_state| voice_state.channel_id);
|
|
||||||
|
|
||||||
let connect_to = match channel_id {
|
let mut rest_playlist: VecDeque<String> = VecDeque::new();
|
||||||
Some(channel) => channel,
|
|
||||||
None => {
|
if manager.get(guild_id).is_none() {
|
||||||
let msg = "I am not in a voice channel!";
|
let channel_id = ctx
|
||||||
|
.guild()
|
||||||
|
.unwrap()
|
||||||
|
.voice_states
|
||||||
|
.get(&ctx.author().id)
|
||||||
|
.and_then(|voice_state| voice_state.channel_id);
|
||||||
|
|
||||||
|
let connect_to = match channel_id {
|
||||||
|
Some(channel) => channel,
|
||||||
|
None => {
|
||||||
|
let msg = "I am not in a voice channel!";
|
||||||
|
ctx.send(CreateReply::default().embed(error_embed(ctx, msg).await.unwrap()))
|
||||||
|
.await?;
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if let Ok(handler_lock) = manager.join(guild_id, connect_to).await {
|
||||||
|
let mut handler = handler_lock.lock().await;
|
||||||
|
handler.add_global_event(TrackEvent::Error.into(), TrackErrorNotifier);
|
||||||
|
|
||||||
|
rest_playlist = handle_play(ctx, song, handler, http_client.clone())
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
} else {
|
||||||
|
let msg = "Failed to join the voice channel!";
|
||||||
ctx.send(CreateReply::default().embed(error_embed(ctx, msg).await.unwrap()))
|
ctx.send(CreateReply::default().embed(error_embed(ctx, msg).await.unwrap()))
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
return Ok(());
|
|
||||||
}
|
}
|
||||||
};
|
} else {
|
||||||
|
let handler = manager.get(guild_id).unwrap();
|
||||||
let http_client = {
|
let mut handler = handler.lock().await;
|
||||||
let data = ctx.serenity_context().data.read().await;
|
|
||||||
data.get::<HttpKey>()
|
|
||||||
.cloned()
|
|
||||||
.expect("Guaranteed to exist in the typemap.")
|
|
||||||
};
|
|
||||||
|
|
||||||
let manager = songbird::get(&ctx.serenity_context())
|
|
||||||
.await
|
|
||||||
.expect("Songbird Voice placed at init")
|
|
||||||
.clone();
|
|
||||||
|
|
||||||
if let Ok(handler_lock) = manager.join(guild_id, connect_to).await {
|
|
||||||
let mut handler = handler_lock.lock().await;
|
|
||||||
|
|
||||||
handler.add_global_event(TrackEvent::Error.into(), TrackErrorNotifier);
|
handler.add_global_event(TrackEvent::Error.into(), TrackErrorNotifier);
|
||||||
|
rest_playlist = handle_play(ctx, song, handler, http_client.clone())
|
||||||
if is_playlist && is_spotify {
|
|
||||||
let raw_list = Command::new("node")
|
|
||||||
.args(["./src/spotify-parser", &song])
|
|
||||||
.output()
|
|
||||||
.expect("failed to execute process")
|
|
||||||
.stdout;
|
|
||||||
let list = String::from_utf8(raw_list.clone()).expect("Invalid UTF-8");
|
|
||||||
|
|
||||||
let tracks: Vec<String> = list.split("\n").map(str::to_string).collect();
|
|
||||||
|
|
||||||
for (index, url) in tracks.clone().iter().enumerate() {
|
|
||||||
if url.is_empty() {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
let src = YoutubeDl::new_ytdl_like(
|
|
||||||
"yt-dlp",
|
|
||||||
http_client.clone(),
|
|
||||||
format!("ytsearch:{}", url.to_string()),
|
|
||||||
);
|
|
||||||
let aux_metadata = src.clone().aux_metadata().await.unwrap();
|
|
||||||
let track = handler.enqueue_input(src.clone().into()).await;
|
|
||||||
let _ = track
|
|
||||||
.typemap()
|
|
||||||
.write()
|
|
||||||
.await
|
|
||||||
.insert::<Metadata>(aux_metadata);
|
|
||||||
|
|
||||||
if index == 0 {
|
|
||||||
let embed = generate_playlist_embed(ctx, track, tracks.len()).await;
|
|
||||||
let response = CreateReply::default().embed(embed.unwrap());
|
|
||||||
ctx.send(response).await?;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return Ok(());
|
|
||||||
}
|
|
||||||
|
|
||||||
if is_playlist {
|
|
||||||
let raw_list = Command::new("yt-dlp")
|
|
||||||
.args(["-j", "--flat-playlist", &song])
|
|
||||||
.output()
|
|
||||||
.expect("failed to execute process")
|
|
||||||
.stdout;
|
|
||||||
|
|
||||||
let list = String::from_utf8(raw_list.clone()).expect("Invalid UTF-8");
|
|
||||||
|
|
||||||
let urls: Vec<String> = regex_youtube
|
|
||||||
.captures_iter(&list)
|
|
||||||
.map(|capture| capture[1].to_string())
|
|
||||||
.collect();
|
|
||||||
|
|
||||||
for (index, url) in urls.clone().iter().enumerate() {
|
|
||||||
if url.is_empty() {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
let src = YoutubeDl::new_ytdl_like("yt-dlp", http_client.clone(), url.to_string());
|
|
||||||
let aux_metadata = src.clone().aux_metadata().await.unwrap();
|
|
||||||
let track = handler.enqueue_input(src.clone().into()).await;
|
|
||||||
let _ = track
|
|
||||||
.typemap()
|
|
||||||
.write()
|
|
||||||
.await
|
|
||||||
.insert::<Metadata>(aux_metadata);
|
|
||||||
|
|
||||||
if index == 0 {
|
|
||||||
let embed = generate_playlist_embed(ctx, track, urls.len()).await;
|
|
||||||
let response = CreateReply::default().embed(embed.unwrap());
|
|
||||||
ctx.send(response).await?;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return Ok(());
|
|
||||||
}
|
|
||||||
|
|
||||||
if is_spotify {
|
|
||||||
let query = Command::new("node")
|
|
||||||
.args(["./src/spotify-parser", &song])
|
|
||||||
.output()
|
|
||||||
.expect("failed to execute process")
|
|
||||||
.stdout;
|
|
||||||
let query_str = String::from_utf8(query.clone()).expect("Invalid UTF-8");
|
|
||||||
song = format!("ytsearch:{}", query_str.to_string());
|
|
||||||
}
|
|
||||||
|
|
||||||
if is_query {
|
|
||||||
song = format!("ytsearch:{}", song);
|
|
||||||
}
|
|
||||||
|
|
||||||
let src = YoutubeDl::new_ytdl_like("yt-dlp", http_client, song);
|
|
||||||
let embed = generate_embed(ctx, src.clone(), handler.queue()).await;
|
|
||||||
let response = CreateReply::default().embed(embed.unwrap());
|
|
||||||
ctx.send(response).await?;
|
|
||||||
|
|
||||||
let aux_metadata = src.clone().aux_metadata().await.unwrap();
|
|
||||||
|
|
||||||
let track = handler.enqueue_input(src.clone().into()).await;
|
|
||||||
let _ = track
|
|
||||||
.typemap()
|
|
||||||
.write()
|
|
||||||
.await
|
.await
|
||||||
.insert::<Metadata>(aux_metadata);
|
.unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
handle_playlist(rest_playlist, manager, guild_id, http_client)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn handle_play<'a>(
|
||||||
|
ctx: Context<'a>,
|
||||||
|
song: String,
|
||||||
|
mut handler: tokio::sync::MutexGuard<'a, Call>,
|
||||||
|
http_client: Client,
|
||||||
|
) -> Result<VecDeque<String>, Error> {
|
||||||
|
let mut results = parse_data(song).await;
|
||||||
|
|
||||||
|
let src: YoutubeDl =
|
||||||
|
YoutubeDl::new_ytdl_like("yt-dlp", http_client, results.pop_front().unwrap());
|
||||||
|
|
||||||
|
ctx.send(
|
||||||
|
CreateReply::default().embed(
|
||||||
|
generate_embed(ctx, src.clone(), handler.queue(), results.clone())
|
||||||
|
.await
|
||||||
|
.unwrap(),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.await?;
|
||||||
|
|
||||||
|
let aux_metadata = src.clone().aux_metadata().await.unwrap();
|
||||||
|
|
||||||
|
handler
|
||||||
|
.enqueue_input(src.clone().into())
|
||||||
|
.await
|
||||||
|
.typemap()
|
||||||
|
.write()
|
||||||
|
.await
|
||||||
|
.insert::<Metadata>(aux_metadata);
|
||||||
|
|
||||||
|
Ok(results)
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn parse_data(data: String) -> VecDeque<String> {
|
||||||
|
let tracks = lib_spotify_parser::retrieve_async_url(&data)
|
||||||
|
.await
|
||||||
|
.unwrap_or(vec![data])
|
||||||
|
.iter()
|
||||||
|
.flat_map(|track| {
|
||||||
|
if track.contains("?list=") {
|
||||||
|
let regex_youtube = Regex_Classic::new(
|
||||||
|
r#""url": "(https://www.youtube.com/watch\?v=[A-Za-z0-9]{11})""#,
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
let list = Command::new("yt-dlp")
|
||||||
|
.args(["-j", "--flat-playlist", track])
|
||||||
|
.output()
|
||||||
|
.expect("Failed to execute process")
|
||||||
|
.stdout;
|
||||||
|
let list = String::from_utf8(list).unwrap();
|
||||||
|
|
||||||
|
regex_youtube
|
||||||
|
.captures_iter(&list)
|
||||||
|
.map(|capture| capture.get(1).unwrap().as_str().to_string())
|
||||||
|
.collect::<Vec<String>>()
|
||||||
|
} else if track.starts_with("http") {
|
||||||
|
vec![track.clone()]
|
||||||
|
} else {
|
||||||
|
vec![format!("ytsearch:{}", track)]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.collect();
|
||||||
|
|
||||||
|
tracks
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn handle_playlist(
|
||||||
|
playlist: VecDeque<String>,
|
||||||
|
manager: std::sync::Arc<songbird::Songbird>,
|
||||||
|
guild_id: GuildId,
|
||||||
|
http_client: Client,
|
||||||
|
) -> Result<(), Error> {
|
||||||
|
for song in playlist {
|
||||||
|
if manager.get(guild_id).is_some() {
|
||||||
|
let handler = manager.get(guild_id).unwrap();
|
||||||
|
let mut handler = handler.lock().await;
|
||||||
|
|
||||||
|
let src: YoutubeDl =
|
||||||
|
YoutubeDl::new_ytdl_like("yt-dlp", http_client.clone(), song.clone());
|
||||||
|
|
||||||
|
let aux_metadata = src.clone().aux_metadata().await.unwrap();
|
||||||
|
|
||||||
|
handler
|
||||||
|
.enqueue_input(src.clone().into())
|
||||||
|
.await
|
||||||
|
.typemap()
|
||||||
|
.write()
|
||||||
|
.await
|
||||||
|
.insert::<Metadata>(aux_metadata);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -196,6 +186,7 @@ async fn generate_embed(
|
|||||||
ctx: Context<'_>,
|
ctx: Context<'_>,
|
||||||
src: YoutubeDl,
|
src: YoutubeDl,
|
||||||
queue: &TrackQueue,
|
queue: &TrackQueue,
|
||||||
|
results: VecDeque<String>,
|
||||||
) -> Result<CreateEmbed, Error> {
|
) -> Result<CreateEmbed, Error> {
|
||||||
let metadata = src.clone().aux_metadata().await.unwrap();
|
let metadata = src.clone().aux_metadata().await.unwrap();
|
||||||
let AuxMetadata {
|
let AuxMetadata {
|
||||||
@@ -206,18 +197,22 @@ async fn generate_embed(
|
|||||||
duration,
|
duration,
|
||||||
..
|
..
|
||||||
} = metadata;
|
} = metadata;
|
||||||
let timestamp = Timestamp::now();
|
|
||||||
let duration_minutes = duration.unwrap_or(Duration::new(0, 0)).clone().as_secs() / 60;
|
let duration_minutes = duration.unwrap_or(Duration::new(0, 0)).clone().as_secs() / 60;
|
||||||
let duration_seconds = duration.unwrap_or(Duration::new(0, 0)).clone().as_secs() % 60;
|
let duration_seconds = duration.unwrap_or(Duration::new(0, 0)).clone().as_secs() % 60;
|
||||||
let mut description = format!("Song added to queue @ {}", queue.len() + 1);
|
let mut description = format!("Enqueued @ {}", queue.len() + 1);
|
||||||
|
let mut tracks = "Tracks enqueued";
|
||||||
|
|
||||||
if queue.len() == 0 {
|
if results.len() == 1 {
|
||||||
description = format!("Playing now!");
|
tracks = "Track enqueued";
|
||||||
|
}
|
||||||
|
|
||||||
|
if queue.is_empty() {
|
||||||
|
description = "Playing now!".to_string();
|
||||||
}
|
}
|
||||||
|
|
||||||
let embed = CreateEmbed::default()
|
let embed = CreateEmbed::default()
|
||||||
.author(CreateEmbedAuthor::new("Track enqueued").icon_url(ctx.author().clone().face()))
|
.author(CreateEmbedAuthor::new(tracks).icon_url(ctx.author().clone().face()))
|
||||||
.colour(Colour::from_rgb(255, 58, 97))
|
.colour(Color::from_rgb(255, 58, 97))
|
||||||
.title(title.unwrap())
|
.title(title.unwrap())
|
||||||
.url(source_url.unwrap())
|
.url(source_url.unwrap())
|
||||||
.thumbnail(thumbnail.unwrap_or(ctx.cache().current_user().face()))
|
.thumbnail(thumbnail.unwrap_or(ctx.cache().current_user().face()))
|
||||||
@@ -233,59 +228,7 @@ async fn generate_embed(
|
|||||||
)
|
)
|
||||||
.field("DJ", ctx.author().name.clone(), true)
|
.field("DJ", ctx.author().name.clone(), true)
|
||||||
.description(description)
|
.description(description)
|
||||||
.timestamp(timestamp)
|
.timestamp(Timestamp::now())
|
||||||
.footer(
|
|
||||||
CreateEmbedFooter::new(ctx.cache().current_user().name.to_string())
|
|
||||||
.icon_url(ctx.cache().current_user().face()),
|
|
||||||
);
|
|
||||||
|
|
||||||
Ok(embed)
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn generate_playlist_embed(
|
|
||||||
ctx: Context<'_>,
|
|
||||||
track: TrackHandle,
|
|
||||||
queue_length: usize,
|
|
||||||
) -> Result<CreateEmbed, Error> {
|
|
||||||
let meta_typemap = track.typemap().read().await;
|
|
||||||
let metadata = meta_typemap.get::<Metadata>().unwrap();
|
|
||||||
let AuxMetadata {
|
|
||||||
title,
|
|
||||||
thumbnail,
|
|
||||||
source_url,
|
|
||||||
artist,
|
|
||||||
duration,
|
|
||||||
..
|
|
||||||
} = metadata;
|
|
||||||
let timestamp = Timestamp::now();
|
|
||||||
let duration_minutes = duration.unwrap_or(Duration::new(0, 0)).clone().as_secs() / 60;
|
|
||||||
let duration_seconds = duration.unwrap_or(Duration::new(0, 0)).clone().as_secs() % 60;
|
|
||||||
|
|
||||||
let description = format!("Enqueued tracks: {}", queue_length - 1);
|
|
||||||
|
|
||||||
let embed = CreateEmbed::default()
|
|
||||||
.author(CreateEmbedAuthor::new("Playlist enqueued").icon_url(ctx.author().clone().face()))
|
|
||||||
.colour(Colour::from_rgb(255, 58, 97))
|
|
||||||
.title(title.as_ref().unwrap())
|
|
||||||
.url(source_url.as_ref().unwrap())
|
|
||||||
.thumbnail(
|
|
||||||
thumbnail
|
|
||||||
.as_ref()
|
|
||||||
.unwrap_or(&ctx.cache().current_user().face()),
|
|
||||||
)
|
|
||||||
.field(
|
|
||||||
"Artist",
|
|
||||||
artist.as_ref().unwrap_or(&"Unknown Artist".to_string()),
|
|
||||||
true,
|
|
||||||
)
|
|
||||||
.field(
|
|
||||||
"Duration",
|
|
||||||
format!("{:02}:{:02}", duration_minutes, duration_seconds),
|
|
||||||
true,
|
|
||||||
)
|
|
||||||
.field("DJ", ctx.author().name.clone(), true)
|
|
||||||
.description(description)
|
|
||||||
.timestamp(timestamp)
|
|
||||||
.footer(
|
.footer(
|
||||||
CreateEmbedFooter::new(ctx.cache().current_user().name.to_string())
|
CreateEmbedFooter::new(ctx.cache().current_user().name.to_string())
|
||||||
.icon_url(ctx.cache().current_user().face()),
|
.icon_url(ctx.cache().current_user().face()),
|
||||||
|
|||||||
@@ -2,12 +2,10 @@ use std::time::Duration;
|
|||||||
|
|
||||||
use crate::commands::music::metadata::Metadata;
|
use crate::commands::music::metadata::Metadata;
|
||||||
use crate::{commands::embeds::error_embed, Context, Error};
|
use crate::{commands::embeds::error_embed, Context, Error};
|
||||||
use poise::serenity_prelude::CreateEmbed;
|
use poise::serenity_prelude::{
|
||||||
use poise::CreateReply;
|
Color, CreateEmbed, CreateEmbedAuthor, CreateEmbedFooter, Timestamp,
|
||||||
use serenity::{
|
|
||||||
builder::{CreateEmbedAuthor, CreateEmbedFooter},
|
|
||||||
model::{Colour, Timestamp},
|
|
||||||
};
|
};
|
||||||
|
use poise::CreateReply;
|
||||||
use songbird::input::AuxMetadata;
|
use songbird::input::AuxMetadata;
|
||||||
|
|
||||||
const QUEUE_DISPLAY_LENGTH: usize = 10;
|
const QUEUE_DISPLAY_LENGTH: usize = 10;
|
||||||
@@ -18,7 +16,7 @@ const QUEUE_DISPLAY_LENGTH: usize = 10;
|
|||||||
pub async fn queue(ctx: Context<'_>) -> Result<(), Error> {
|
pub async fn queue(ctx: Context<'_>) -> Result<(), Error> {
|
||||||
let guild_id = ctx.guild_id().unwrap();
|
let guild_id = ctx.guild_id().unwrap();
|
||||||
|
|
||||||
let manager = songbird::get(&ctx.serenity_context())
|
let manager = songbird::get(ctx.serenity_context())
|
||||||
.await
|
.await
|
||||||
.expect("Songbird client placed at init")
|
.expect("Songbird client placed at init")
|
||||||
.clone();
|
.clone();
|
||||||
@@ -80,7 +78,7 @@ async fn embed(ctx: Context<'_>, queue: String) -> Result<CreateEmbed, Error> {
|
|||||||
|
|
||||||
let embed = CreateEmbed::default()
|
let embed = CreateEmbed::default()
|
||||||
.author(CreateEmbedAuthor::new("Queue").icon_url(ctx.author().clone().face()))
|
.author(CreateEmbedAuthor::new("Queue").icon_url(ctx.author().clone().face()))
|
||||||
.colour(Colour::from_rgb(255, 58, 97))
|
.colour(Color::from_rgb(255, 58, 97))
|
||||||
.title(title)
|
.title(title)
|
||||||
.description(queue)
|
.description(queue)
|
||||||
.timestamp(timestamp)
|
.timestamp(timestamp)
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ pub async fn repeat(
|
|||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
let guild_id = ctx.guild_id().unwrap();
|
let guild_id = ctx.guild_id().unwrap();
|
||||||
|
|
||||||
let manager = songbird::get(&ctx.serenity_context())
|
let manager = songbird::get(ctx.serenity_context())
|
||||||
.await
|
.await
|
||||||
.expect("Songbird client placed at init")
|
.expect("Songbird client placed at init")
|
||||||
.clone();
|
.clone();
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ use poise::CreateReply;
|
|||||||
pub async fn resume(ctx: Context<'_>) -> Result<(), Error> {
|
pub async fn resume(ctx: Context<'_>) -> Result<(), Error> {
|
||||||
let guild_id = ctx.guild_id().unwrap();
|
let guild_id = ctx.guild_id().unwrap();
|
||||||
|
|
||||||
let manager = songbird::get(&ctx.serenity_context())
|
let manager = songbird::get(ctx.serenity_context())
|
||||||
.await
|
.await
|
||||||
.expect("Songbird client placed at init")
|
.expect("Songbird client placed at init")
|
||||||
.clone();
|
.clone();
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ pub async fn seek(
|
|||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
let guild_id = ctx.guild_id().unwrap();
|
let guild_id = ctx.guild_id().unwrap();
|
||||||
|
|
||||||
let manager = songbird::get(&ctx.serenity_context())
|
let manager = songbird::get(ctx.serenity_context())
|
||||||
.await
|
.await
|
||||||
.expect("Songbird client placed at init")
|
.expect("Songbird client placed at init")
|
||||||
.clone();
|
.clone();
|
||||||
|
|||||||
@@ -5,25 +5,19 @@ use crate::{
|
|||||||
commands::embeds::{embed, error_embed},
|
commands::embeds::{embed, error_embed},
|
||||||
Context, Error,
|
Context, Error,
|
||||||
};
|
};
|
||||||
use poise::CreateReply;
|
use poise::serenity_prelude::{
|
||||||
use serenity::{
|
Color, CreateEmbed, CreateEmbedAuthor, CreateEmbedFooter, Timestamp,
|
||||||
builder::{CreateEmbed, CreateEmbedAuthor, CreateEmbedFooter},
|
|
||||||
model::{Colour, Timestamp},
|
|
||||||
};
|
};
|
||||||
|
use poise::CreateReply;
|
||||||
use songbird::{input::AuxMetadata, tracks::TrackHandle};
|
use songbird::{input::AuxMetadata, tracks::TrackHandle};
|
||||||
|
|
||||||
/// Skips the currently playing song; \
|
/// Skips the currently playing song; \
|
||||||
/// aliases: skip, :skipper:
|
/// aliases: skip, :skipper:
|
||||||
#[poise::command(
|
#[poise::command(prefix_command, slash_command, aliases("skipper:"), category = "Music")]
|
||||||
prefix_command,
|
|
||||||
slash_command,
|
|
||||||
aliases("skipper:"),
|
|
||||||
category = "Music"
|
|
||||||
)]
|
|
||||||
pub async fn skip(ctx: Context<'_>) -> Result<(), Error> {
|
pub async fn skip(ctx: Context<'_>) -> Result<(), Error> {
|
||||||
let guild_id = ctx.guild_id().unwrap();
|
let guild_id = ctx.guild_id().unwrap();
|
||||||
|
|
||||||
let manager = songbird::get(&ctx.serenity_context())
|
let manager = songbird::get(ctx.serenity_context())
|
||||||
.await
|
.await
|
||||||
.expect("Songbird client placed at init")
|
.expect("Songbird client placed at init")
|
||||||
.clone();
|
.clone();
|
||||||
@@ -36,23 +30,18 @@ pub async fn skip(ctx: Context<'_>) -> Result<(), Error> {
|
|||||||
let track = track_raw.get(1);
|
let track = track_raw.get(1);
|
||||||
let queue_length = queue.len() - 1;
|
let queue_length = queue.len() - 1;
|
||||||
|
|
||||||
let response;
|
let mut response = CreateReply::default().embed(
|
||||||
|
embed(ctx, "Skipped!", "The queue is empty!", "")
|
||||||
|
.await
|
||||||
|
.unwrap(),
|
||||||
|
);
|
||||||
|
|
||||||
match track {
|
if let Some(track) = track {
|
||||||
Some(track) => {
|
response = CreateReply::default().embed(
|
||||||
response = CreateReply::default().embed(
|
generate_embed(ctx, track.clone(), queue_length)
|
||||||
generate_embed(ctx, track.clone(), queue_length)
|
.await
|
||||||
.await
|
.unwrap(),
|
||||||
.unwrap(),
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
None => {
|
|
||||||
response = CreateReply::default().embed(
|
|
||||||
embed(ctx, "Skipped!", "The queue is empty!", "")
|
|
||||||
.await
|
|
||||||
.unwrap(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ctx.send(response).await?;
|
ctx.send(response).await?;
|
||||||
@@ -88,7 +77,7 @@ async fn generate_embed(
|
|||||||
|
|
||||||
let embed = CreateEmbed::default()
|
let embed = CreateEmbed::default()
|
||||||
.author(CreateEmbedAuthor::new("Skipped!").icon_url(ctx.author().clone().face()))
|
.author(CreateEmbedAuthor::new("Skipped!").icon_url(ctx.author().clone().face()))
|
||||||
.colour(Colour::from_rgb(255, 58, 97))
|
.colour(Color::from_rgb(255, 58, 97))
|
||||||
.title(title.as_ref().unwrap())
|
.title(title.as_ref().unwrap())
|
||||||
.url(source_url.as_ref().unwrap())
|
.url(source_url.as_ref().unwrap())
|
||||||
.thumbnail(
|
.thumbnail(
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
use crate::{commands::embeds::error_embed, Context, Error};
|
use crate::{commands::embeds::error_embed, Context, Error};
|
||||||
|
|
||||||
use poise::serenity_prelude::model::Timestamp;
|
use poise::serenity_prelude::{
|
||||||
use poise::serenity_prelude::Colour;
|
Color, CreateEmbed, CreateEmbedAuthor, CreateEmbedFooter, Timestamp,
|
||||||
use poise::serenity_prelude::CreateEmbed;
|
};
|
||||||
use poise::CreateReply;
|
use poise::CreateReply;
|
||||||
use serenity::builder::CreateEmbedAuthor;
|
|
||||||
use serenity::builder::CreateEmbedFooter;
|
|
||||||
use songbird::events::TrackEvent;
|
use songbird::events::TrackEvent;
|
||||||
use songbird::input::AuxMetadata;
|
use songbird::input::AuxMetadata;
|
||||||
use songbird::input::{Compose, YoutubeDl};
|
use songbird::input::{Compose, YoutubeDl};
|
||||||
@@ -36,7 +34,7 @@ pub async fn effect(
|
|||||||
.expect("Guaranteed to exist in the typemap.")
|
.expect("Guaranteed to exist in the typemap.")
|
||||||
};
|
};
|
||||||
|
|
||||||
let manager = songbird::get(&ctx.serenity_context())
|
let manager = songbird::get(ctx.serenity_context())
|
||||||
.await
|
.await
|
||||||
.expect("Songbird Voice placed at init")
|
.expect("Songbird Voice placed at init")
|
||||||
.clone();
|
.clone();
|
||||||
@@ -87,11 +85,11 @@ async fn generate_embed(ctx: Context<'_>, src: YoutubeDl) -> Result<CreateEmbed,
|
|||||||
let duration_minutes = duration.unwrap_or(Duration::new(0, 0)).clone().as_secs() / 60;
|
let duration_minutes = duration.unwrap_or(Duration::new(0, 0)).clone().as_secs() / 60;
|
||||||
let duration_seconds = duration.unwrap_or(Duration::new(0, 0)).clone().as_secs() % 60;
|
let duration_seconds = duration.unwrap_or(Duration::new(0, 0)).clone().as_secs() % 60;
|
||||||
|
|
||||||
let description = format!("Playing now!");
|
let description = "Playing now!";
|
||||||
|
|
||||||
let embed = CreateEmbed::default()
|
let embed = CreateEmbed::default()
|
||||||
.author(CreateEmbedAuthor::new("Playing an effect!").icon_url(ctx.author().clone().face()))
|
.author(CreateEmbedAuthor::new("Playing an effect!").icon_url(ctx.author().clone().face()))
|
||||||
.colour(Colour::from_rgb(255, 58, 97))
|
.colour(Color::from_rgb(255, 58, 97))
|
||||||
.title(title.unwrap())
|
.title(title.unwrap())
|
||||||
.url(source_url.unwrap())
|
.url(source_url.unwrap())
|
||||||
.thumbnail(thumbnail.unwrap_or(ctx.cache().current_user().face()))
|
.thumbnail(thumbnail.unwrap_or(ctx.cache().current_user().face()))
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
use crate::{commands::embeds::error_embed, Context, Error};
|
use crate::{commands::embeds::error_embed, Context, Error};
|
||||||
|
|
||||||
use poise::serenity_prelude::model::Timestamp;
|
use poise::serenity_prelude::{
|
||||||
use poise::serenity_prelude::Colour;
|
Color, CreateEmbed, CreateEmbedAuthor, CreateEmbedFooter, Timestamp,
|
||||||
use poise::serenity_prelude::CreateEmbed;
|
};
|
||||||
use poise::CreateReply;
|
use poise::CreateReply;
|
||||||
use serenity::builder::CreateEmbedAuthor;
|
|
||||||
use serenity::builder::CreateEmbedFooter;
|
|
||||||
use songbird::events::TrackEvent;
|
use songbird::events::TrackEvent;
|
||||||
use songbird::input::AuxMetadata;
|
use songbird::input::AuxMetadata;
|
||||||
use songbird::input::{Compose, YoutubeDl};
|
use songbird::input::{Compose, YoutubeDl};
|
||||||
@@ -43,7 +41,7 @@ pub async fn stream(
|
|||||||
.expect("Guaranteed to exist in the typemap.")
|
.expect("Guaranteed to exist in the typemap.")
|
||||||
};
|
};
|
||||||
|
|
||||||
let manager = songbird::get(&ctx.serenity_context())
|
let manager = songbird::get(ctx.serenity_context())
|
||||||
.await
|
.await
|
||||||
.expect("Songbird Voice placed at init")
|
.expect("Songbird Voice placed at init")
|
||||||
.clone();
|
.clone();
|
||||||
@@ -94,13 +92,13 @@ async fn generate_embed(ctx: Context<'_>, src: YoutubeDl) -> Result<CreateEmbed,
|
|||||||
let duration_minutes = duration.unwrap_or(Duration::new(0, 0)).clone().as_secs() / 60;
|
let duration_minutes = duration.unwrap_or(Duration::new(0, 0)).clone().as_secs() / 60;
|
||||||
let duration_seconds = duration.unwrap_or(Duration::new(0, 0)).clone().as_secs() % 60;
|
let duration_seconds = duration.unwrap_or(Duration::new(0, 0)).clone().as_secs() % 60;
|
||||||
|
|
||||||
let description = format!("Playing now!");
|
let description = "Playing now!";
|
||||||
|
|
||||||
let embed = CreateEmbed::default()
|
let embed = CreateEmbed::default()
|
||||||
.author(
|
.author(
|
||||||
CreateEmbedAuthor::new("Audio output hijacked!").icon_url(ctx.author().clone().face()),
|
CreateEmbedAuthor::new("Audio output hijacked!").icon_url(ctx.author().clone().face()),
|
||||||
)
|
)
|
||||||
.colour(Colour::from_rgb(255, 58, 97))
|
.colour(Color::from_rgb(255, 58, 97))
|
||||||
.title(title.unwrap())
|
.title(title.unwrap())
|
||||||
.url(source_url.unwrap())
|
.url(source_url.unwrap())
|
||||||
.thumbnail(thumbnail.unwrap_or(ctx.cache().current_user().face()))
|
.thumbnail(thumbnail.unwrap_or(ctx.cache().current_user().face()))
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ use poise::CreateReply;
|
|||||||
pub async fn stop(ctx: Context<'_>) -> Result<(), Error> {
|
pub async fn stop(ctx: Context<'_>) -> Result<(), Error> {
|
||||||
let guild_id = ctx.guild_id().unwrap();
|
let guild_id = ctx.guild_id().unwrap();
|
||||||
|
|
||||||
let manager = songbird::get(&ctx.serenity_context())
|
let manager = songbird::get(ctx.serenity_context())
|
||||||
.await
|
.await
|
||||||
.expect("Songbird client placed at init")
|
.expect("Songbird client placed at init")
|
||||||
.clone();
|
.clone();
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ use poise::CreateReply;
|
|||||||
pub async fn volume(ctx: Context<'_>, #[description = "Volume"] volume: f32) -> Result<(), Error> {
|
pub async fn volume(ctx: Context<'_>, #[description = "Volume"] volume: f32) -> Result<(), Error> {
|
||||||
let guild_id = ctx.guild_id().unwrap();
|
let guild_id = ctx.guild_id().unwrap();
|
||||||
|
|
||||||
let manager = songbird::get(&ctx.serenity_context())
|
let manager = songbird::get(ctx.serenity_context())
|
||||||
.await
|
.await
|
||||||
.expect("Songbird client placed at init")
|
.expect("Songbird client placed at init")
|
||||||
.clone();
|
.clone();
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ pub mod posix;
|
|||||||
pub mod qr;
|
pub mod qr;
|
||||||
pub mod register;
|
pub mod register;
|
||||||
pub mod taf;
|
pub mod taf;
|
||||||
// pub mod uptime;
|
pub mod uptime;
|
||||||
pub mod verse;
|
pub mod verse;
|
||||||
pub mod weather;
|
pub mod weather;
|
||||||
|
|
||||||
@@ -26,6 +26,6 @@ pub use posix::posix;
|
|||||||
pub use qr::qr;
|
pub use qr::qr;
|
||||||
pub use register::register;
|
pub use register::register;
|
||||||
pub use taf::taf;
|
pub use taf::taf;
|
||||||
// pub use uptime::uptime;
|
pub use uptime::uptime;
|
||||||
pub use verse::verse;
|
pub use verse::verse;
|
||||||
pub use weather::weather;
|
pub use weather::weather;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ pub async fn ai(
|
|||||||
#[rest]
|
#[rest]
|
||||||
prompt: String,
|
prompt: String,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
let iamsorry = vec![
|
let iamsorry = &[
|
||||||
"I'm sorry, but as an AI language model, I must follow ethical guidelines, and I cannot engage in harmful, malicious, or offensive behavior.",
|
"I'm sorry, but as an AI language model, I must follow ethical guidelines, and I cannot engage in harmful, malicious, or offensive behavior.",
|
||||||
"I'm sorry, but as an AI language model, I may not always be perfect and can make mistakes or provide inaccurate information. Please verify important details from reliable sources.",
|
"I'm sorry, but as an AI language model, I may not always be perfect and can make mistakes or provide inaccurate information. Please verify important details from reliable sources.",
|
||||||
"I'm sorry, but as an AI language model, I can't engage in real-time conversations or remember previous interactions with users.",
|
"I'm sorry, but as an AI language model, I can't engage in real-time conversations or remember previous interactions with users.",
|
||||||
@@ -27,19 +27,17 @@ pub async fn ai(
|
|||||||
|
|
||||||
println!("Funny prompts: {}", prompt);
|
println!("Funny prompts: {}", prompt);
|
||||||
|
|
||||||
let response;
|
let response = {
|
||||||
|
|
||||||
let _ = {
|
|
||||||
let mut rng = rand::thread_rng();
|
let mut rng = rand::thread_rng();
|
||||||
|
|
||||||
response = rng.gen_range(0..iamsorry.len());
|
rng.gen_range(0..iamsorry.len())
|
||||||
};
|
};
|
||||||
|
|
||||||
sleep(Duration::from_secs(3));
|
sleep(Duration::from_secs(1));
|
||||||
|
|
||||||
ctx.send(
|
ctx.send(
|
||||||
CreateReply::default().embed(
|
CreateReply::default().embed(
|
||||||
embed(ctx, "AI Response:", "", &format!("{}", iamsorry[response]))
|
embed(ctx, "AI Response:", "", iamsorry[response])
|
||||||
.await
|
.await
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -7,12 +7,9 @@ use crate::{commands::embeds::embed, Context, Error};
|
|||||||
/// Rolls a dice
|
/// Rolls a dice
|
||||||
#[poise::command(prefix_command, slash_command, category = "Tools")]
|
#[poise::command(prefix_command, slash_command, category = "Tools")]
|
||||||
pub async fn dice(ctx: Context<'_>) -> Result<(), Error> {
|
pub async fn dice(ctx: Context<'_>) -> Result<(), Error> {
|
||||||
let dice;
|
let dice = {
|
||||||
|
|
||||||
let _ = {
|
|
||||||
let mut rng = rand::thread_rng();
|
let mut rng = rand::thread_rng();
|
||||||
|
rng.gen_range(1..=6)
|
||||||
dice = rng.gen_range(1..7);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ctx.send(
|
ctx.send(
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
use poise::CreateReply;
|
use poise::serenity_prelude::{
|
||||||
use serenity::{
|
Color, CreateEmbed, CreateEmbedAuthor, CreateEmbedFooter, Timestamp,
|
||||||
builder::{CreateEmbed, CreateEmbedAuthor, CreateEmbedFooter},
|
|
||||||
model::{Colour, Timestamp},
|
|
||||||
};
|
};
|
||||||
|
use poise::CreateReply;
|
||||||
|
|
||||||
use crate::{Context, Error};
|
use crate::{Context, Error};
|
||||||
use url::form_urlencoded;
|
use url::form_urlencoded;
|
||||||
@@ -34,7 +33,7 @@ async fn generate_embed(ctx: Context<'_>, message: String) -> Result<CreateEmbed
|
|||||||
CreateEmbedAuthor::new("Your message as a QR Code!")
|
CreateEmbedAuthor::new("Your message as a QR Code!")
|
||||||
.icon_url(ctx.author().clone().face()),
|
.icon_url(ctx.author().clone().face()),
|
||||||
)
|
)
|
||||||
.colour(Colour::from_rgb(255, 58, 97))
|
.colour(Color::from_rgb(255, 58, 97))
|
||||||
.title("Your QR Code:")
|
.title("Your QR Code:")
|
||||||
.url(url.clone())
|
.url(url.clone())
|
||||||
.image(url)
|
.image(url)
|
||||||
|
|||||||
@@ -1,35 +1,48 @@
|
|||||||
|
use once_cell::sync::Lazy;
|
||||||
use poise::CreateReply;
|
use poise::CreateReply;
|
||||||
|
use std::sync::Mutex;
|
||||||
|
|
||||||
use crate::{commands::embeds::embed, Context, Error};
|
use crate::{commands::embeds::embed, Context, Error};
|
||||||
|
|
||||||
// Currently unable to get information on how long the thread was running.
|
pub static PROCESS_UPTIME: Lazy<Mutex<std::time::SystemTime>> =
|
||||||
const PROCESS_UPTIME: i64 = 1000;
|
Lazy::new(|| Mutex::new(std::time::SystemTime::now()));
|
||||||
|
|
||||||
/// Checks how long the bot has been running
|
/// Checks how long the bot has been running
|
||||||
#[poise::command(prefix_command, slash_command, category = "Tools")]
|
#[poise::command(prefix_command, slash_command, category = "Tools")]
|
||||||
pub async fn uptime(ctx: Context<'_>) -> Result<(), Error> {
|
pub async fn uptime(ctx: Context<'_>) -> Result<(), Error> {
|
||||||
let uptime = PROCESS_UPTIME;
|
let start = *PROCESS_UPTIME.lock().unwrap();
|
||||||
let days = uptime / (24 * 60 * 60);
|
let uptime = std::time::SystemTime::now().duration_since(start).unwrap();
|
||||||
let hours = (uptime % (24 * 60 * 60)) / 3600;
|
|
||||||
let minutes = (uptime % 60 * 60) / 60;
|
|
||||||
let seconds = uptime % 60;
|
|
||||||
|
|
||||||
ctx.send(
|
let (days, hours, minutes, seconds) = (
|
||||||
CreateReply::default().embed(
|
uptime.as_secs() / 86400,
|
||||||
embed(
|
(uptime.as_secs() / 3600) % 24,
|
||||||
ctx,
|
(uptime.as_secs() / 60) % 60,
|
||||||
"I have been up and awake for",
|
uptime.as_secs() % 60,
|
||||||
&format!("{} seconds", uptime),
|
);
|
||||||
&format!(
|
|
||||||
"{} days, {} hours, {} minutes and {} seconds",
|
let mut message = format!(
|
||||||
days, hours, minutes, seconds
|
"I have been awake for {} days, {} hours, {} minutes and {} seconds!",
|
||||||
),
|
days, hours, minutes, seconds
|
||||||
)
|
);
|
||||||
.await
|
|
||||||
.unwrap(),
|
if days != 0 {
|
||||||
),
|
message = format!("I have been awake for {} days!", days);
|
||||||
)
|
}
|
||||||
.await?;
|
|
||||||
|
if days == 0 && hours != 0 {
|
||||||
|
message = format!("I have been awake for {} hours!", hours);
|
||||||
|
}
|
||||||
|
|
||||||
|
if days == 0 && hours == 0 && minutes != 0 {
|
||||||
|
message = format!("I have been awake for {} minutes!", minutes);
|
||||||
|
}
|
||||||
|
|
||||||
|
if days == 0 && hours == 0 && minutes == 0 && seconds != 0 {
|
||||||
|
message = format!("I have been awake for {} seconds!", seconds);
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx.send(CreateReply::default().embed(embed(ctx, "Uptime", "", &message).await.unwrap()))
|
||||||
|
.await?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
25
src/main.rs
25
src/main.rs
@@ -1,3 +1,4 @@
|
|||||||
|
use commands::tools::uptime::PROCESS_UPTIME;
|
||||||
use poise::serenity_prelude::{self as serenity, ActivityData};
|
use poise::serenity_prelude::{self as serenity, ActivityData};
|
||||||
use reqwest::Client as HttpClient;
|
use reqwest::Client as HttpClient;
|
||||||
use songbird::SerenityInit;
|
use songbird::SerenityInit;
|
||||||
@@ -8,7 +9,6 @@ use tracing::{error, info, warn};
|
|||||||
mod commands;
|
mod commands;
|
||||||
mod http;
|
mod http;
|
||||||
|
|
||||||
use crate::commands::kashi;
|
|
||||||
use crate::commands::music;
|
use crate::commands::music;
|
||||||
use crate::commands::tools;
|
use crate::commands::tools;
|
||||||
use crate::http::HttpKey;
|
use crate::http::HttpKey;
|
||||||
@@ -16,7 +16,9 @@ use crate::http::HttpKey;
|
|||||||
type Error = Box<dyn std::error::Error + Send + Sync>;
|
type Error = Box<dyn std::error::Error + Send + Sync>;
|
||||||
type Context<'a> = poise::Context<'a, Data, Error>;
|
type Context<'a> = poise::Context<'a, Data, Error>;
|
||||||
|
|
||||||
pub struct Data;
|
pub struct Data {
|
||||||
|
pub http_client: HttpClient,
|
||||||
|
}
|
||||||
|
|
||||||
async fn on_error(error: poise::FrameworkError<'_, Data, Error>) {
|
async fn on_error(error: poise::FrameworkError<'_, Data, Error>) {
|
||||||
match error {
|
match error {
|
||||||
@@ -37,12 +39,13 @@ async fn main() {
|
|||||||
tracing_subscriber::fmt::init();
|
tracing_subscriber::fmt::init();
|
||||||
dotenv::dotenv().expect("Failed to load .env file.");
|
dotenv::dotenv().expect("Failed to load .env file.");
|
||||||
|
|
||||||
|
let _ = *PROCESS_UPTIME.lock().unwrap();
|
||||||
|
|
||||||
let token =
|
let token =
|
||||||
std::env::var("DISCORD_TOKEN").expect("Environment variable `DISCORD_TOKEN` not found!");
|
std::env::var("DISCORD_TOKEN").expect("Environment variable `DISCORD_TOKEN` not found!");
|
||||||
let prefix = std::env::var("PREFIX").expect("Environment variable `PREFIX` not found!");
|
let prefix = std::env::var("PREFIX").expect("Environment variable `PREFIX` not found!");
|
||||||
|
|
||||||
let commands = vec![
|
let commands = vec![
|
||||||
kashi::kashi(),
|
|
||||||
music::deafen(),
|
music::deafen(),
|
||||||
music::join(),
|
music::join(),
|
||||||
music::leave(),
|
music::leave(),
|
||||||
@@ -70,7 +73,7 @@ async fn main() {
|
|||||||
tools::qr(),
|
tools::qr(),
|
||||||
tools::register(),
|
tools::register(),
|
||||||
tools::taf(),
|
tools::taf(),
|
||||||
// tools::uptime(),
|
tools::uptime(),
|
||||||
tools::verse(),
|
tools::verse(),
|
||||||
tools::weather(),
|
tools::weather(),
|
||||||
];
|
];
|
||||||
@@ -78,7 +81,7 @@ async fn main() {
|
|||||||
let options = poise::FrameworkOptions {
|
let options = poise::FrameworkOptions {
|
||||||
commands,
|
commands,
|
||||||
prefix_options: poise::PrefixFrameworkOptions {
|
prefix_options: poise::PrefixFrameworkOptions {
|
||||||
prefix: Some(prefix.to_string().into()),
|
prefix: Some(prefix.to_string()),
|
||||||
edit_tracker: Some(Arc::new(poise::EditTracker::for_timespan(
|
edit_tracker: Some(Arc::new(poise::EditTracker::for_timespan(
|
||||||
Duration::from_secs(3600),
|
Duration::from_secs(3600),
|
||||||
))),
|
))),
|
||||||
@@ -123,7 +126,7 @@ async fn main() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let framework = poise::Framework::builder()
|
let framework = poise::Framework::builder()
|
||||||
.setup(move |ctx, ready, _framework| {
|
.setup(move |ctx, ready, framework| {
|
||||||
Box::pin(async move {
|
Box::pin(async move {
|
||||||
info!(
|
info!(
|
||||||
"{} [{}] connected successfully!",
|
"{} [{}] connected successfully!",
|
||||||
@@ -131,8 +134,16 @@ async fn main() {
|
|||||||
);
|
);
|
||||||
ctx.set_activity(Some(ActivityData::listening(prefix + "help")));
|
ctx.set_activity(Some(ActivityData::listening(prefix + "help")));
|
||||||
// poise::builtins::register_globally(ctx, &framework.options().commands).await?;
|
// poise::builtins::register_globally(ctx, &framework.options().commands).await?;
|
||||||
|
poise::builtins::register_in_guild(
|
||||||
|
ctx,
|
||||||
|
&framework.options().commands,
|
||||||
|
512680330495524873.into(),
|
||||||
|
)
|
||||||
|
.await?;
|
||||||
|
|
||||||
Ok(Data {})
|
Ok(Data {
|
||||||
|
http_client: HttpClient::new(),
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.options(options)
|
.options(options)
|
||||||
|
|||||||
Submodule src/spotify-parser deleted from e3b3c0fb6e
Reference in New Issue
Block a user