diff --git a/.env.TEMPLATE b/.env.TEMPLATE
index 79fec62..0289214 100644
--- a/.env.TEMPLATE
+++ b/.env.TEMPLATE
@@ -1,3 +1,5 @@
-export POSTGRES_USER=
-export POSTGRES_PASSWORD=
-export POSTGRES_DB=
\ No newline at end of file
+DISCORD_TOKEN=
+RUST_LOG=warn,siren=info
+POSTGRES_USER=
+POSTGRES_PASSWORD=
+POSTGRES_DB=
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index a6cd868..add5132 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,8 +1,8 @@
+.env
+target/
.idea/
-**/target/
-**/data/
-**/app/
-**/settings.json
-**/logs/
-**/audio/
-.env
\ No newline at end of file
+.vscode/
+
+audio/
+logs/
+settings.json
diff --git a/.version b/.version
index e43e32d..a571b01 100644
--- a/.version
+++ b/.version
@@ -1 +1 @@
-export SIREN_VERSION=0.1.24
\ No newline at end of file
+export SIREN_VERSION=0.2.0
\ No newline at end of file
diff --git a/Cargo.lock b/Cargo.lock
new file mode 100644
index 0000000..123fed6
--- /dev/null
+++ b/Cargo.lock
@@ -0,0 +1,2130 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+version = 3
+
+[[package]]
+name = "addr2line"
+version = "0.20.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3"
+dependencies = [
+ "gimli",
+]
+
+[[package]]
+name = "adler"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
+
+[[package]]
+name = "aead"
+version = "0.4.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877"
+dependencies = [
+ "generic-array",
+ "rand_core",
+]
+
+[[package]]
+name = "aho-corasick"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41"
+dependencies = [
+ "memchr",
+]
+
+[[package]]
+name = "arrayvec"
+version = "0.7.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711"
+
+[[package]]
+name = "async-trait"
+version = "0.1.69"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7b2d0f03b3640e3a630367e40c468cb7f309529c708ed1d88597047b0e7c6ef7"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.23",
+]
+
+[[package]]
+name = "async-tungstenite"
+version = "0.17.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a1b71b31561643aa8e7df3effe284fa83ab1a840e52294c5f4bd7bfd8b2becbb"
+dependencies = [
+ "futures-io",
+ "futures-util",
+ "log",
+ "pin-project-lite",
+ "tokio",
+ "tokio-rustls 0.23.4",
+ "tungstenite",
+ "webpki-roots",
+]
+
+[[package]]
+name = "audiopus"
+version = "0.3.0-rc.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ab55eb0e56d7c6de3d59f544e5db122d7725ec33be6a276ee8241f3be6473955"
+dependencies = [
+ "audiopus_sys",
+]
+
+[[package]]
+name = "audiopus_sys"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "62314a1546a2064e033665d658e88c620a62904be945f8147e6b16c3db9f8651"
+dependencies = [
+ "cmake",
+ "log",
+ "pkg-config",
+]
+
+[[package]]
+name = "autocfg"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
+
+[[package]]
+name = "backtrace"
+version = "0.3.68"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12"
+dependencies = [
+ "addr2line",
+ "cc",
+ "cfg-if",
+ "libc",
+ "miniz_oxide",
+ "object",
+ "rustc-demangle",
+]
+
+[[package]]
+name = "base64"
+version = "0.13.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8"
+
+[[package]]
+name = "base64"
+version = "0.21.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d"
+
+[[package]]
+name = "bitflags"
+version = "1.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
+
+[[package]]
+name = "bitflags"
+version = "2.3.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42"
+
+[[package]]
+name = "block-buffer"
+version = "0.10.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
+dependencies = [
+ "generic-array",
+]
+
+[[package]]
+name = "bumpalo"
+version = "3.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1"
+
+[[package]]
+name = "bytemuck"
+version = "1.13.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea"
+
+[[package]]
+name = "byteorder"
+version = "1.4.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
+
+[[package]]
+name = "bytes"
+version = "1.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be"
+
+[[package]]
+name = "cc"
+version = "1.0.79"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f"
+
+[[package]]
+name = "cfg-if"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
+
+[[package]]
+name = "cipher"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7"
+dependencies = [
+ "generic-array",
+]
+
+[[package]]
+name = "cmake"
+version = "0.1.50"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130"
+dependencies = [
+ "cc",
+]
+
+[[package]]
+name = "command_attr"
+version = "0.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "07b787d19b9806dd4c9c34b2b4147d1a61d6120d93ee289521ab9b0294d198e4"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 1.0.109",
+]
+
+[[package]]
+name = "cpufeatures"
+version = "0.2.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "03e69e28e9f7f77debdedbaafa2866e1de9ba56df55a8bd7cfc724c25a09987c"
+dependencies = [
+ "libc",
+]
+
+[[package]]
+name = "crc32fast"
+version = "1.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d"
+dependencies = [
+ "cfg-if",
+]
+
+[[package]]
+name = "crossbeam-utils"
+version = "0.8.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294"
+dependencies = [
+ "cfg-if",
+]
+
+[[package]]
+name = "crypto-common"
+version = "0.1.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3"
+dependencies = [
+ "generic-array",
+ "typenum",
+]
+
+[[package]]
+name = "dashmap"
+version = "5.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "907076dfda823b0b36d2a1bb5f90c96660a5bbcd7729e10727f07858f22c4edc"
+dependencies = [
+ "cfg-if",
+ "hashbrown",
+ "lock_api",
+ "once_cell",
+ "parking_lot_core",
+ "serde",
+]
+
+[[package]]
+name = "derivative"
+version = "2.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 1.0.109",
+]
+
+[[package]]
+name = "digest"
+version = "0.10.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
+dependencies = [
+ "block-buffer",
+ "crypto-common",
+]
+
+[[package]]
+name = "discortp"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fb66017646a48220b5ea30d63ac18bb5952f647f1a41ed755880895125d26972"
+dependencies = [
+ "pnet_macros",
+ "pnet_macros_support",
+]
+
+[[package]]
+name = "dotenv"
+version = "0.15.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f"
+
+[[package]]
+name = "encoding_rs"
+version = "0.8.32"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394"
+dependencies = [
+ "cfg-if",
+]
+
+[[package]]
+name = "enum_primitive"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "be4551092f4d519593039259a9ed8daedf0da12e5109c5280338073eaeb81180"
+dependencies = [
+ "num-traits 0.1.43",
+]
+
+[[package]]
+name = "env_logger"
+version = "0.10.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0"
+dependencies = [
+ "humantime",
+ "is-terminal",
+ "log",
+ "regex",
+ "termcolor",
+]
+
+[[package]]
+name = "errno"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a"
+dependencies = [
+ "errno-dragonfly",
+ "libc",
+ "windows-sys",
+]
+
+[[package]]
+name = "errno-dragonfly"
+version = "0.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf"
+dependencies = [
+ "cc",
+ "libc",
+]
+
+[[package]]
+name = "flate2"
+version = "1.0.26"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743"
+dependencies = [
+ "crc32fast",
+ "miniz_oxide",
+]
+
+[[package]]
+name = "flume"
+version = "0.10.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1657b4441c3403d9f7b3409e47575237dac27b1b5726df654a6ecbf92f0f7577"
+dependencies = [
+ "futures-core",
+ "futures-sink",
+ "nanorand",
+ "pin-project",
+ "spin 0.9.8",
+]
+
+[[package]]
+name = "fnv"
+version = "1.0.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
+
+[[package]]
+name = "form_urlencoded"
+version = "1.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652"
+dependencies = [
+ "percent-encoding",
+]
+
+[[package]]
+name = "futures"
+version = "0.3.28"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40"
+dependencies = [
+ "futures-channel",
+ "futures-core",
+ "futures-executor",
+ "futures-io",
+ "futures-sink",
+ "futures-task",
+ "futures-util",
+]
+
+[[package]]
+name = "futures-channel"
+version = "0.3.28"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2"
+dependencies = [
+ "futures-core",
+ "futures-sink",
+]
+
+[[package]]
+name = "futures-core"
+version = "0.3.28"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c"
+
+[[package]]
+name = "futures-executor"
+version = "0.3.28"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0"
+dependencies = [
+ "futures-core",
+ "futures-task",
+ "futures-util",
+]
+
+[[package]]
+name = "futures-io"
+version = "0.3.28"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964"
+
+[[package]]
+name = "futures-macro"
+version = "0.3.28"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.23",
+]
+
+[[package]]
+name = "futures-sink"
+version = "0.3.28"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e"
+
+[[package]]
+name = "futures-task"
+version = "0.3.28"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65"
+
+[[package]]
+name = "futures-util"
+version = "0.3.28"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533"
+dependencies = [
+ "futures-channel",
+ "futures-core",
+ "futures-io",
+ "futures-macro",
+ "futures-sink",
+ "futures-task",
+ "memchr",
+ "pin-project-lite",
+ "pin-utils",
+ "slab",
+]
+
+[[package]]
+name = "generator"
+version = "0.7.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5cc16584ff22b460a382b7feec54b23d2908d858152e5739a120b949293bd74e"
+dependencies = [
+ "cc",
+ "libc",
+ "log",
+ "rustversion",
+ "windows",
+]
+
+[[package]]
+name = "generic-array"
+version = "0.14.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
+dependencies = [
+ "typenum",
+ "version_check",
+]
+
+[[package]]
+name = "getrandom"
+version = "0.2.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427"
+dependencies = [
+ "cfg-if",
+ "js-sys",
+ "libc",
+ "wasi",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "gimli"
+version = "0.27.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e"
+
+[[package]]
+name = "h2"
+version = "0.3.20"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049"
+dependencies = [
+ "bytes",
+ "fnv",
+ "futures-core",
+ "futures-sink",
+ "futures-util",
+ "http",
+ "indexmap",
+ "slab",
+ "tokio",
+ "tokio-util",
+ "tracing",
+]
+
+[[package]]
+name = "hashbrown"
+version = "0.12.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
+
+[[package]]
+name = "hermit-abi"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b"
+
+[[package]]
+name = "http"
+version = "0.2.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482"
+dependencies = [
+ "bytes",
+ "fnv",
+ "itoa",
+]
+
+[[package]]
+name = "http-body"
+version = "0.4.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1"
+dependencies = [
+ "bytes",
+ "http",
+ "pin-project-lite",
+]
+
+[[package]]
+name = "httparse"
+version = "1.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904"
+
+[[package]]
+name = "httpdate"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421"
+
+[[package]]
+name = "humantime"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
+
+[[package]]
+name = "hyper"
+version = "0.14.27"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468"
+dependencies = [
+ "bytes",
+ "futures-channel",
+ "futures-core",
+ "futures-util",
+ "h2",
+ "http",
+ "http-body",
+ "httparse",
+ "httpdate",
+ "itoa",
+ "pin-project-lite",
+ "socket2",
+ "tokio",
+ "tower-service",
+ "tracing",
+ "want",
+]
+
+[[package]]
+name = "hyper-rustls"
+version = "0.24.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97"
+dependencies = [
+ "futures-util",
+ "http",
+ "hyper",
+ "rustls 0.21.2",
+ "tokio",
+ "tokio-rustls 0.24.1",
+]
+
+[[package]]
+name = "idna"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c"
+dependencies = [
+ "unicode-bidi",
+ "unicode-normalization",
+]
+
+[[package]]
+name = "indexmap"
+version = "1.9.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99"
+dependencies = [
+ "autocfg",
+ "hashbrown",
+]
+
+[[package]]
+name = "ipnet"
+version = "2.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6"
+
+[[package]]
+name = "is-terminal"
+version = "0.4.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "24fddda5af7e54bf7da53067d6e802dbcc381d0a8eef629df528e3ebf68755cb"
+dependencies = [
+ "hermit-abi",
+ "rustix",
+ "windows-sys",
+]
+
+[[package]]
+name = "itoa"
+version = "1.0.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "62b02a5381cc465bd3041d84623d0fa3b66738b52b8e2fc3bab8ad63ab032f4a"
+
+[[package]]
+name = "js-sys"
+version = "0.3.64"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a"
+dependencies = [
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "lazy_static"
+version = "1.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
+
+[[package]]
+name = "levenshtein"
+version = "1.0.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "db13adb97ab515a3691f56e4dbab09283d0b86cb45abd991d8634a9d6f501760"
+
+[[package]]
+name = "libc"
+version = "0.2.147"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3"
+
+[[package]]
+name = "linux-raw-sys"
+version = "0.4.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0"
+
+[[package]]
+name = "lock_api"
+version = "0.4.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16"
+dependencies = [
+ "autocfg",
+ "scopeguard",
+]
+
+[[package]]
+name = "log"
+version = "0.4.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4"
+
+[[package]]
+name = "loom"
+version = "0.5.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5"
+dependencies = [
+ "cfg-if",
+ "generator",
+ "scoped-tls",
+ "serde",
+ "serde_json",
+ "tracing",
+ "tracing-subscriber",
+]
+
+[[package]]
+name = "matchers"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558"
+dependencies = [
+ "regex-automata",
+]
+
+[[package]]
+name = "memchr"
+version = "2.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
+
+[[package]]
+name = "mime"
+version = "0.3.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
+
+[[package]]
+name = "mime_guess"
+version = "2.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef"
+dependencies = [
+ "mime",
+ "unicase",
+]
+
+[[package]]
+name = "miniz_oxide"
+version = "0.7.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7"
+dependencies = [
+ "adler",
+]
+
+[[package]]
+name = "mio"
+version = "0.8.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2"
+dependencies = [
+ "libc",
+ "wasi",
+ "windows-sys",
+]
+
+[[package]]
+name = "nanorand"
+version = "0.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3"
+dependencies = [
+ "getrandom",
+]
+
+[[package]]
+name = "nu-ansi-term"
+version = "0.46.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84"
+dependencies = [
+ "overload",
+ "winapi",
+]
+
+[[package]]
+name = "num-traits"
+version = "0.1.43"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31"
+dependencies = [
+ "num-traits 0.2.15",
+]
+
+[[package]]
+name = "num-traits"
+version = "0.2.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd"
+dependencies = [
+ "autocfg",
+]
+
+[[package]]
+name = "num_cpus"
+version = "1.16.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43"
+dependencies = [
+ "hermit-abi",
+ "libc",
+]
+
+[[package]]
+name = "object"
+version = "0.31.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1"
+dependencies = [
+ "memchr",
+]
+
+[[package]]
+name = "once_cell"
+version = "1.18.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"
+
+[[package]]
+name = "opaque-debug"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
+
+[[package]]
+name = "ordered-float"
+version = "2.10.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7940cf2ca942593318d07fcf2596cdca60a85c9e7fab408a5e21a4f9dcd40d87"
+dependencies = [
+ "num-traits 0.2.15",
+]
+
+[[package]]
+name = "overload"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
+
+[[package]]
+name = "parking_lot"
+version = "0.12.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
+dependencies = [
+ "lock_api",
+ "parking_lot_core",
+]
+
+[[package]]
+name = "parking_lot_core"
+version = "0.9.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447"
+dependencies = [
+ "cfg-if",
+ "libc",
+ "redox_syscall",
+ "smallvec",
+ "windows-targets",
+]
+
+[[package]]
+name = "percent-encoding"
+version = "2.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94"
+
+[[package]]
+name = "pin-project"
+version = "1.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "030ad2bc4db10a8944cb0d837f158bdfec4d4a4873ab701a95046770d11f8842"
+dependencies = [
+ "pin-project-internal",
+]
+
+[[package]]
+name = "pin-project-internal"
+version = "1.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.23",
+]
+
+[[package]]
+name = "pin-project-lite"
+version = "0.2.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57"
+
+[[package]]
+name = "pin-utils"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
+
+[[package]]
+name = "pkg-config"
+version = "0.3.27"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964"
+
+[[package]]
+name = "pnet_base"
+version = "0.28.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "25488cd551a753dcaaa6fffc9f69a7610a412dd8954425bf7ffad5f7d1156fb8"
+
+[[package]]
+name = "pnet_macros"
+version = "0.28.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "30490e0852e58402b8fae0d39897b08a24f493023a4d6cf56b2e30f31ed57548"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "regex",
+ "syn 1.0.109",
+]
+
+[[package]]
+name = "pnet_macros_support"
+version = "0.28.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d4714e10f30cab023005adce048f2d30dd4ac4f093662abf2220855655ef8f90"
+dependencies = [
+ "pnet_base",
+]
+
+[[package]]
+name = "poly1305"
+version = "0.7.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "048aeb476be11a4b6ca432ca569e375810de9294ae78f4774e78ea98a9246ede"
+dependencies = [
+ "cpufeatures",
+ "opaque-debug",
+ "universal-hash",
+]
+
+[[package]]
+name = "ppv-lite86"
+version = "0.2.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
+
+[[package]]
+name = "proc-macro2"
+version = "1.0.63"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb"
+dependencies = [
+ "unicode-ident",
+]
+
+[[package]]
+name = "quote"
+version = "1.0.29"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105"
+dependencies = [
+ "proc-macro2",
+]
+
+[[package]]
+name = "rand"
+version = "0.8.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
+dependencies = [
+ "libc",
+ "rand_chacha",
+ "rand_core",
+]
+
+[[package]]
+name = "rand_chacha"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
+dependencies = [
+ "ppv-lite86",
+ "rand_core",
+]
+
+[[package]]
+name = "rand_core"
+version = "0.6.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
+dependencies = [
+ "getrandom",
+]
+
+[[package]]
+name = "redox_syscall"
+version = "0.3.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29"
+dependencies = [
+ "bitflags 1.3.2",
+]
+
+[[package]]
+name = "regex"
+version = "1.8.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f"
+dependencies = [
+ "aho-corasick",
+ "memchr",
+ "regex-syntax 0.7.2",
+]
+
+[[package]]
+name = "regex-automata"
+version = "0.1.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132"
+dependencies = [
+ "regex-syntax 0.6.29",
+]
+
+[[package]]
+name = "regex-syntax"
+version = "0.6.29"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1"
+
+[[package]]
+name = "regex-syntax"
+version = "0.7.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78"
+
+[[package]]
+name = "reqwest"
+version = "0.11.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55"
+dependencies = [
+ "base64 0.21.2",
+ "bytes",
+ "encoding_rs",
+ "futures-core",
+ "futures-util",
+ "h2",
+ "http",
+ "http-body",
+ "hyper",
+ "hyper-rustls",
+ "ipnet",
+ "js-sys",
+ "log",
+ "mime",
+ "mime_guess",
+ "once_cell",
+ "percent-encoding",
+ "pin-project-lite",
+ "rustls 0.21.2",
+ "rustls-pemfile",
+ "serde",
+ "serde_json",
+ "serde_urlencoded",
+ "tokio",
+ "tokio-rustls 0.24.1",
+ "tokio-util",
+ "tower-service",
+ "url",
+ "wasm-bindgen",
+ "wasm-bindgen-futures",
+ "wasm-streams",
+ "web-sys",
+ "webpki-roots",
+ "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",
+ "web-sys",
+ "winapi",
+]
+
+[[package]]
+name = "rustc-demangle"
+version = "0.1.23"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76"
+
+[[package]]
+name = "rustix"
+version = "0.38.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "aabcb0461ebd01d6b79945797c27f8529082226cb630a9865a71870ff63532a4"
+dependencies = [
+ "bitflags 2.3.3",
+ "errno",
+ "libc",
+ "linux-raw-sys",
+ "windows-sys",
+]
+
+[[package]]
+name = "rustls"
+version = "0.20.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f"
+dependencies = [
+ "log",
+ "ring",
+ "sct",
+ "webpki",
+]
+
+[[package]]
+name = "rustls"
+version = "0.21.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e32ca28af694bc1bbf399c33a516dbdf1c90090b8ab23c2bc24f834aa2247f5f"
+dependencies = [
+ "log",
+ "ring",
+ "rustls-webpki",
+ "sct",
+]
+
+[[package]]
+name = "rustls-pemfile"
+version = "1.0.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2"
+dependencies = [
+ "base64 0.21.2",
+]
+
+[[package]]
+name = "rustls-webpki"
+version = "0.100.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d6207cd5ed3d8dca7816f8f3725513a34609c0c765bf652b8c3cb4cfd87db46b"
+dependencies = [
+ "ring",
+ "untrusted",
+]
+
+[[package]]
+name = "rustversion"
+version = "1.0.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dc31bd9b61a32c31f9650d18add92aa83a49ba979c143eefd27fe7177b05bd5f"
+
+[[package]]
+name = "ryu"
+version = "1.0.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fe232bdf6be8c8de797b22184ee71118d63780ea42ac85b61d1baa6d3b782ae9"
+
+[[package]]
+name = "salsa20"
+version = "0.9.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0c0fbb5f676da676c260ba276a8f43a8dc67cf02d1438423aeb1c677a7212686"
+dependencies = [
+ "cipher",
+ "zeroize",
+]
+
+[[package]]
+name = "scoped-tls"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294"
+
+[[package]]
+name = "scopeguard"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
+
+[[package]]
+name = "sct"
+version = "0.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4"
+dependencies = [
+ "ring",
+ "untrusted",
+]
+
+[[package]]
+name = "serde"
+version = "1.0.166"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d01b7404f9d441d3ad40e6a636a7782c377d2abdbe4fa2440e2edcc2f4f10db8"
+dependencies = [
+ "serde_derive",
+]
+
+[[package]]
+name = "serde-value"
+version = "0.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c"
+dependencies = [
+ "ordered-float",
+ "serde",
+]
+
+[[package]]
+name = "serde_derive"
+version = "1.0.166"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5dd83d6dde2b6b2d466e14d9d1acce8816dedee94f735eac6395808b3483c6d6"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.23",
+]
+
+[[package]]
+name = "serde_json"
+version = "1.0.99"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "46266871c240a00b8f503b877622fe33430b3c7d963bdc0f2adc511e54a1eae3"
+dependencies = [
+ "itoa",
+ "ryu",
+ "serde",
+]
+
+[[package]]
+name = "serde_repr"
+version = "0.1.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6f0a21fba416426ac927b1691996e82079f8b6156e920c85345f135b2e9ba2de"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.23",
+]
+
+[[package]]
+name = "serde_urlencoded"
+version = "0.7.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"
+dependencies = [
+ "form_urlencoded",
+ "itoa",
+ "ryu",
+ "serde",
+]
+
+[[package]]
+name = "serenity"
+version = "0.11.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d007dc45584ecc47e791f2a9a7cf17bf98ac386728106f111159c846d624be3f"
+dependencies = [
+ "async-trait",
+ "async-tungstenite",
+ "base64 0.13.1",
+ "bitflags 1.3.2",
+ "bytes",
+ "cfg-if",
+ "command_attr",
+ "dashmap",
+ "flate2",
+ "futures",
+ "levenshtein",
+ "mime",
+ "mime_guess",
+ "parking_lot",
+ "percent-encoding",
+ "reqwest",
+ "serde",
+ "serde-value",
+ "serde_json",
+ "static_assertions",
+ "time",
+ "tokio",
+ "tracing",
+ "typemap_rev",
+ "url",
+ "uwl",
+]
+
+[[package]]
+name = "serenity-voice-model"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8be3aec8849ca2fde1e8a5dfbed96fbd68e9b5f4283fbe277d8694ce811d4952"
+dependencies = [
+ "bitflags 1.3.2",
+ "enum_primitive",
+ "serde",
+ "serde_json",
+ "serde_repr",
+]
+
+[[package]]
+name = "sha-1"
+version = "0.10.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c"
+dependencies = [
+ "cfg-if",
+ "cpufeatures",
+ "digest",
+]
+
+[[package]]
+name = "sharded-slab"
+version = "0.1.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31"
+dependencies = [
+ "lazy_static",
+]
+
+[[package]]
+name = "signal-hook-registry"
+version = "1.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1"
+dependencies = [
+ "libc",
+]
+
+[[package]]
+name = "siren"
+version = "0.2.0"
+dependencies = [
+ "dotenv",
+ "env_logger",
+ "log",
+ "reqwest",
+ "serde",
+ "serde_json",
+ "serenity",
+ "songbird",
+ "tokio",
+]
+
+[[package]]
+name = "slab"
+version = "0.4.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d"
+dependencies = [
+ "autocfg",
+]
+
+[[package]]
+name = "smallvec"
+version = "1.10.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0"
+
+[[package]]
+name = "socket2"
+version = "0.4.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662"
+dependencies = [
+ "libc",
+ "winapi",
+]
+
+[[package]]
+name = "songbird"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "32f686a0fd771939de1da3e43cee45169fafe1595770b94680572cf18bdef288"
+dependencies = [
+ "async-trait",
+ "async-tungstenite",
+ "audiopus",
+ "byteorder",
+ "dashmap",
+ "derivative",
+ "discortp",
+ "flume",
+ "futures",
+ "parking_lot",
+ "pin-project",
+ "rand",
+ "serde",
+ "serde_json",
+ "serenity",
+ "serenity-voice-model",
+ "streamcatcher",
+ "symphonia-core",
+ "tokio",
+ "tracing",
+ "tracing-futures",
+ "typemap_rev",
+ "url",
+ "uuid",
+ "xsalsa20poly1305",
+]
+
+[[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"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67"
+dependencies = [
+ "lock_api",
+]
+
+[[package]]
+name = "static_assertions"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
+
+[[package]]
+name = "streamcatcher"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "71664755c349abb0758fda6218fb2d2391ca2a73f9302c03b145491db4fcea29"
+dependencies = [
+ "crossbeam-utils",
+ "futures-util",
+ "loom",
+]
+
+[[package]]
+name = "subtle"
+version = "2.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601"
+
+[[package]]
+name = "symphonia-core"
+version = "0.5.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f7c73eb88fee79705268cc7b742c7bc93a7b76e092ab751d0833866970754142"
+dependencies = [
+ "arrayvec",
+ "bitflags 1.3.2",
+ "bytemuck",
+ "lazy_static",
+ "log",
+]
+
+[[package]]
+name = "syn"
+version = "1.0.109"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-ident",
+]
+
+[[package]]
+name = "syn"
+version = "2.0.23"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "59fb7d6d8281a51045d62b8eb3a7d1ce347b76f312af50cd3dc0af39c87c1737"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-ident",
+]
+
+[[package]]
+name = "termcolor"
+version = "1.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6"
+dependencies = [
+ "winapi-util",
+]
+
+[[package]]
+name = "thiserror"
+version = "1.0.40"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac"
+dependencies = [
+ "thiserror-impl",
+]
+
+[[package]]
+name = "thiserror-impl"
+version = "1.0.40"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.23",
+]
+
+[[package]]
+name = "thread_local"
+version = "1.1.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152"
+dependencies = [
+ "cfg-if",
+ "once_cell",
+]
+
+[[package]]
+name = "time"
+version = "0.3.22"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ea9e1b3cf1243ae005d9e74085d4d542f3125458f3a81af210d901dcd7411efd"
+dependencies = [
+ "itoa",
+ "serde",
+ "time-core",
+ "time-macros",
+]
+
+[[package]]
+name = "time-core"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb"
+
+[[package]]
+name = "time-macros"
+version = "0.2.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "372950940a5f07bf38dbe211d7283c9e6d7327df53794992d293e534c733d09b"
+dependencies = [
+ "time-core",
+]
+
+[[package]]
+name = "tinyvec"
+version = "1.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50"
+dependencies = [
+ "tinyvec_macros",
+]
+
+[[package]]
+name = "tinyvec_macros"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
+
+[[package]]
+name = "tokio"
+version = "1.29.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da"
+dependencies = [
+ "autocfg",
+ "backtrace",
+ "bytes",
+ "libc",
+ "mio",
+ "num_cpus",
+ "pin-project-lite",
+ "signal-hook-registry",
+ "socket2",
+ "tokio-macros",
+ "windows-sys",
+]
+
+[[package]]
+name = "tokio-macros"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.23",
+]
+
+[[package]]
+name = "tokio-rustls"
+version = "0.23.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59"
+dependencies = [
+ "rustls 0.20.8",
+ "tokio",
+ "webpki",
+]
+
+[[package]]
+name = "tokio-rustls"
+version = "0.24.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081"
+dependencies = [
+ "rustls 0.21.2",
+ "tokio",
+]
+
+[[package]]
+name = "tokio-util"
+version = "0.7.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d"
+dependencies = [
+ "bytes",
+ "futures-core",
+ "futures-sink",
+ "pin-project-lite",
+ "tokio",
+ "tracing",
+]
+
+[[package]]
+name = "tower-service"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52"
+
+[[package]]
+name = "tracing"
+version = "0.1.37"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8"
+dependencies = [
+ "cfg-if",
+ "log",
+ "pin-project-lite",
+ "tracing-attributes",
+ "tracing-core",
+]
+
+[[package]]
+name = "tracing-attributes"
+version = "0.1.26"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.23",
+]
+
+[[package]]
+name = "tracing-core"
+version = "0.1.31"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a"
+dependencies = [
+ "once_cell",
+ "valuable",
+]
+
+[[package]]
+name = "tracing-futures"
+version = "0.2.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2"
+dependencies = [
+ "pin-project",
+ "tracing",
+]
+
+[[package]]
+name = "tracing-log"
+version = "0.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922"
+dependencies = [
+ "lazy_static",
+ "log",
+ "tracing-core",
+]
+
+[[package]]
+name = "tracing-subscriber"
+version = "0.3.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77"
+dependencies = [
+ "matchers",
+ "nu-ansi-term",
+ "once_cell",
+ "regex",
+ "sharded-slab",
+ "smallvec",
+ "thread_local",
+ "tracing",
+ "tracing-core",
+ "tracing-log",
+]
+
+[[package]]
+name = "try-lock"
+version = "0.2.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed"
+
+[[package]]
+name = "tungstenite"
+version = "0.17.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e27992fd6a8c29ee7eef28fc78349aa244134e10ad447ce3b9f0ac0ed0fa4ce0"
+dependencies = [
+ "base64 0.13.1",
+ "byteorder",
+ "bytes",
+ "http",
+ "httparse",
+ "log",
+ "rand",
+ "rustls 0.20.8",
+ "sha-1",
+ "thiserror",
+ "url",
+ "utf-8",
+ "webpki",
+]
+
+[[package]]
+name = "typemap_rev"
+version = "0.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ed5b74f0a24b5454580a79abb6994393b09adf0ab8070f15827cb666255de155"
+
+[[package]]
+name = "typenum"
+version = "1.16.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba"
+
+[[package]]
+name = "unicase"
+version = "2.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6"
+dependencies = [
+ "version_check",
+]
+
+[[package]]
+name = "unicode-bidi"
+version = "0.3.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460"
+
+[[package]]
+name = "unicode-ident"
+version = "1.0.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "22049a19f4a68748a168c0fc439f9516686aa045927ff767eca0a85101fb6e73"
+
+[[package]]
+name = "unicode-normalization"
+version = "0.1.22"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921"
+dependencies = [
+ "tinyvec",
+]
+
+[[package]]
+name = "universal-hash"
+version = "0.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05"
+dependencies = [
+ "generic-array",
+ "subtle",
+]
+
+[[package]]
+name = "untrusted"
+version = "0.7.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a"
+
+[[package]]
+name = "url"
+version = "2.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb"
+dependencies = [
+ "form_urlencoded",
+ "idna",
+ "percent-encoding",
+ "serde",
+]
+
+[[package]]
+name = "utf-8"
+version = "0.7.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9"
+
+[[package]]
+name = "uuid"
+version = "0.8.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7"
+dependencies = [
+ "getrandom",
+]
+
+[[package]]
+name = "uwl"
+version = "0.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f4bf03e0ca70d626ecc4ba6b0763b934b6f2976e8c744088bb3c1d646fbb1ad0"
+
+[[package]]
+name = "valuable"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d"
+
+[[package]]
+name = "version_check"
+version = "0.9.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
+
+[[package]]
+name = "want"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e"
+dependencies = [
+ "try-lock",
+]
+
+[[package]]
+name = "wasi"
+version = "0.11.0+wasi-snapshot-preview1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
+
+[[package]]
+name = "wasm-bindgen"
+version = "0.2.87"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342"
+dependencies = [
+ "cfg-if",
+ "wasm-bindgen-macro",
+]
+
+[[package]]
+name = "wasm-bindgen-backend"
+version = "0.2.87"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd"
+dependencies = [
+ "bumpalo",
+ "log",
+ "once_cell",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.23",
+ "wasm-bindgen-shared",
+]
+
+[[package]]
+name = "wasm-bindgen-futures"
+version = "0.4.37"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03"
+dependencies = [
+ "cfg-if",
+ "js-sys",
+ "wasm-bindgen",
+ "web-sys",
+]
+
+[[package]]
+name = "wasm-bindgen-macro"
+version = "0.2.87"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d"
+dependencies = [
+ "quote",
+ "wasm-bindgen-macro-support",
+]
+
+[[package]]
+name = "wasm-bindgen-macro-support"
+version = "0.2.87"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.23",
+ "wasm-bindgen-backend",
+ "wasm-bindgen-shared",
+]
+
+[[package]]
+name = "wasm-bindgen-shared"
+version = "0.2.87"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1"
+
+[[package]]
+name = "wasm-streams"
+version = "0.2.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6bbae3363c08332cadccd13b67db371814cd214c2524020932f0804b8cf7c078"
+dependencies = [
+ "futures-util",
+ "js-sys",
+ "wasm-bindgen",
+ "wasm-bindgen-futures",
+ "web-sys",
+]
+
+[[package]]
+name = "web-sys"
+version = "0.3.64"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b"
+dependencies = [
+ "js-sys",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "webpki"
+version = "0.22.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd"
+dependencies = [
+ "ring",
+ "untrusted",
+]
+
+[[package]]
+name = "webpki-roots"
+version = "0.22.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87"
+dependencies = [
+ "webpki",
+]
+
+[[package]]
+name = "winapi"
+version = "0.3.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
+dependencies = [
+ "winapi-i686-pc-windows-gnu",
+ "winapi-x86_64-pc-windows-gnu",
+]
+
+[[package]]
+name = "winapi-i686-pc-windows-gnu"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
+
+[[package]]
+name = "winapi-util"
+version = "0.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
+dependencies = [
+ "winapi",
+]
+
+[[package]]
+name = "winapi-x86_64-pc-windows-gnu"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
+
+[[package]]
+name = "windows"
+version = "0.48.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f"
+dependencies = [
+ "windows-targets",
+]
+
+[[package]]
+name = "windows-sys"
+version = "0.48.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
+dependencies = [
+ "windows-targets",
+]
+
+[[package]]
+name = "windows-targets"
+version = "0.48.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f"
+dependencies = [
+ "windows_aarch64_gnullvm",
+ "windows_aarch64_msvc",
+ "windows_i686_gnu",
+ "windows_i686_msvc",
+ "windows_x86_64_gnu",
+ "windows_x86_64_gnullvm",
+ "windows_x86_64_msvc",
+]
+
+[[package]]
+name = "windows_aarch64_gnullvm"
+version = "0.48.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc"
+
+[[package]]
+name = "windows_aarch64_msvc"
+version = "0.48.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3"
+
+[[package]]
+name = "windows_i686_gnu"
+version = "0.48.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241"
+
+[[package]]
+name = "windows_i686_msvc"
+version = "0.48.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00"
+
+[[package]]
+name = "windows_x86_64_gnu"
+version = "0.48.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1"
+
+[[package]]
+name = "windows_x86_64_gnullvm"
+version = "0.48.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953"
+
+[[package]]
+name = "windows_x86_64_msvc"
+version = "0.48.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a"
+
+[[package]]
+name = "winreg"
+version = "0.10.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d"
+dependencies = [
+ "winapi",
+]
+
+[[package]]
+name = "xsalsa20poly1305"
+version = "0.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e68bcb965d6c650091450b95cea12f07dcd299a01c15e2f9433b0813ea3c0886"
+dependencies = [
+ "aead",
+ "poly1305",
+ "rand_core",
+ "salsa20",
+ "subtle",
+ "zeroize",
+]
+
+[[package]]
+name = "zeroize"
+version = "1.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd"
diff --git a/Cargo.toml b/Cargo.toml
new file mode 100644
index 0000000..e14b99a
--- /dev/null
+++ b/Cargo.toml
@@ -0,0 +1,34 @@
+[package]
+name = "siren"
+version = "0.2.0"
+edition = "2021"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
+dotenv = "0.15.0"
+serde_json = "1.0"
+log = "0.4.19"
+env_logger = "0.10.0"
+
+[dependencies.serenity]
+version = "0.11.6"
+default-features = false
+features = ["client", "gateway", "rustls_backend", "model", "voice", "cache", "framework", "standard_framework"]
+
+[dependencies.songbird]
+version = "0.3.2"
+features = ["builtin-queue", "yt-dlp"]
+
+[dependencies.tokio]
+version = "1.29.1"
+features = ["macros", "rt-multi-thread"]
+
+[dependencies.serde]
+version = "1.0"
+features = ["derive"]
+
+[dependencies.reqwest]
+version = "0.11.18"
+default-features = false
+features = ["json", "rustls-tls"]
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
index 6cc03b7..3c57b30 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,10 +1,20 @@
-FROM amazoncorretto:17
+FROM rust:1.67 as builder
+WORKDIR /siren
+RUN apt-get update && apt-get install -y cmake && apt-get auto-remove -y
+COPY . .
+RUN cargo build --release --bin siren
-ARG VERSION
+FROM debian:bullseye-slim as packages
+WORKDIR /packages
+RUN apt-get update && apt-get install -y curl tar xz-utils
+RUN curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux > yt-dlp && \
+ chmod +x yt-dlp
+RUN curl -L https://github.com/yt-dlp/FFmpeg-Builds/releases/latest/download/ffmpeg-master-latest-linux64-gpl.tar.xz > ffmpeg.tar.xz && \
+ tar -xJf ffmpeg.tar.xz --wildcards */bin/ffmpeg --transform='s/^.*\///' && rm ffmpeg.tar.xz
-WORKDIR /app
-
-ADD https://repo.local.bensherriff.com/artifactory/libs-release/com/bensherriff/siren/${VERSION}/siren-${VERSION}.jar /usr/local/lib/
-RUN mv /usr/local/lib/siren-${VERSION}.jar /usr/local/lib/siren.jar
-
-ENTRYPOINT ["java", "-jar", "/usr/local/lib/siren.jar"]
+FROM debian:bullseye-slim as runtime
+WORKDIR /siren
+RUN apt-get update && apt-get install -y libopus-dev ffmpeg youtube-dl
+COPY --from=builder /siren/target/release/siren siren
+COPY --from=packages /packages /usr/bin
+CMD ["./siren"]
diff --git a/Makefile b/Makefile
index e5df99a..9253c66 100644
--- a/Makefile
+++ b/Makefile
@@ -3,10 +3,12 @@ include .version
include .env
build:
- if docker inspect siren > /dev/null 2>&1; then docker rmi siren; fi; docker-compose build
+ # if docker inspect siren > /dev/null 2>&1; then docker rmi siren; fi; docker-compose build
+ docker build -t siren .
test:
- docker run --rm -it siren:latest bash
+ # docker run --rm -it siren:latest bash
+ docker run --env-file .env -it --rm --name siren siren:latest
up:
if [[ ! $$(docker images -q siren 2> /dev/null) ]]; then docker-compose build; fi; \
diff --git a/README.md b/README.md
index 88c4167..2414fea 100644
--- a/README.md
+++ b/README.md
@@ -1,72 +1,45 @@
-# Siren
-A Java/Docker Discord music bot
+
+

+
Siren
+
+
+Siren is a D&D Bot built for Discord, written in Rust. Features include:
+- Play tracks from Youtube or locally hosted files
+- Assistant DM tools to be defined later
## Running
-Visit the [Discord Developer Portal](https://discord.com/developers/applications) and create a new application.
-Guides and more information are available [here](https://discord.com/developers/docs/intro).
+Visit the [Discord Developer Portal](https://discord.com/developers/applications) and create a new application. Click [here](https://discord.com/developers/docs/intro) for guides and more information.
-### OAuth2 URL Generator
-The bot requires the following permissions/scopes:
-- bot
-- applications.commands
+Required Scopes:
+ - bot
+ - application.commands
+Example Invite:
```
-https://discord.com/api/oauth2/authorize?client_id=&permissions=1088840792896&scope=applications.commands%20bot
-https://discord.com/api/oauth2/authorize?client_id=&permissions=5469678065984&scope=applications.commands%20bot - bot
- - text permissions
- - send messages
- - create public threads
- - create private threads
- - send messages in threads
- - send tts messages
- - embed links
- - attach files
- - read message history
- - mention everyone
- - use external emojis
- - use external stickers
- - add reactions
- - use slash commands
- - voice permissions
- - connect
- - speak
- - use voice activity
- - priority speaker
- - request to speak
- - use embedded activities
- - use soundboard
- - applications.commands
+https://discord.com/api/oauth2/authorize?client_id=&permissions=40671259392832&scope=bot%20applications.commands
+```
+ - The CLIENT_ID can be found in the General Information tab on the Discord Developer Portal for your application, under `Application ID`
+
+1. Copy `.env.TEMPLATE` to `.env` and fill out the fields
+2. Start the application with `docker compose up -d`
+ - Requires [Docker](https://www.docker.com/)
+
+## Contributing
+[Rust](https://www.rust-lang.org/) must be installed to run locally. See [serenity-rs/serenity](https://github.com/serenity-rs/serenity) for more information about Rust Discord API Library.
+
+Furthermore, the following packages must be installed for [serenity-rs/songbird](https://github.com/serenity-rs/songbird). View the repository for additional installation and setup information on other operating systems.
+```
+sudo apt install libopus-dev
+sudo apt install ffmpeg
+sudo apt apt install youtube-dl
```
+Potentially requires [yt-dlp](https://github.com/yt-dlp/yt-dlp#installation) and [yt-dlp FFmpeg Static Auto-Builds](https://github.com/yt-dlp/FFmpeg-Builds).
+
+Begin the application with `cargo run`
+
+The application can also be tested from within a Docker container:
```
-make build
-make up
-```
-
-## Development
-Build container
-
-`make build`
-
-Run container locally
-
-```
-docker container run --name siren_test -d -t siren bash
-docker exec -it siren_test bash
-```
-
-## Commands
-### Play
-
-### Skip
-
-### Stop
-
-### Volume
-
-### Pause
-
-### Resume
-
-### Settings
-View settings on the current guild.
\ No newline at end of file
+docker build -t siren .
+docker run --env-file .env -it --rm --name siren siren:latest
+```
\ No newline at end of file
diff --git a/docker-compose.yml b/docker-compose.yml
index 3e27ae8..9db9103 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -10,8 +10,9 @@ services:
args:
- VERSION=${SIREN_VERSION}
volumes:
- - ./app:/app
+ - ./app:/usr/src/siren
environment:
+ DISCORD_TOKEN: ${DISCORD_TOKEN}
DATABASE_URL: jdbc:postgresql://db:5432/${POSTGRES_DB}
DATABASE_USERNAME: ${POSTGRES_USER}
DATABASE_PASSWORD: ${POSTGRES_PASSWORD}
diff --git a/pom.xml b/pom.xml
deleted file mode 100644
index f0f29ed..0000000
--- a/pom.xml
+++ /dev/null
@@ -1,181 +0,0 @@
-
-
- 4.0.0
- com.bensherriff
- siren
- ${env.SIREN_VERSION}
- jar
-
-
-
-
- false
-
- central
- libs-release
- https://repo.local.bensherriff.com/artifactory/libs-release
-
-
-
- snapshots
- libs-snapshot
- https://repo.local.bensherriff.com/artifactory/libs-snapshot
-
-
- dv8tion
- m2-dv8tion
- https://m2.dv8tion.net/releases
-
-
- jitpack
- https://jitpack.io
-
-
- maven_central
- Maven Central
- https://repo.maven.apache.org/maven2/
-
-
-
-
-
- false
-
- central
- libs-release
- https://repo.local.bensherriff.com/artifactory/libs-release
-
-
-
- snapshots
- libs-snapshot
- https://repo.local.bensherriff.com/artifactory/libs-snapshot
-
-
-
-
- central
- ffc58a58b429-releases
- https://repo.local.bensherriff.com/artifactory/libs-release
-
-
-
-
- 5.0.0-beta.8
- 1.4.0
- 1.3.13
- 2.14.2
- 0.12.0
- 42.6.0
- 4.2.0
- 2.0.7
- 2.20.0
- UTF-8
- 17
- 17
-
-
-
-
- net.dv8tion
- JDA
- ${jda.version}
-
-
- com.github.walkyst
- lavaplayer-fork
- ${lavaplayer.version}
-
-
- com.fasterxml.jackson.core
- jackson-core
- ${jackson.version}
-
-
- com.fasterxml.jackson.core
- jackson-databind
- ${jackson.version}
-
-
- com.theokanning.openai-gpt3-java
- service
- ${theokanning-openai-gpt3.version}
-
-
- org.postgresql
- postgresql
- ${postgresql.version}
-
-
- edu.stanford.nlp
- stanford-corenlp
- ${corenlp.version}
-
-
- edu.stanford.nlp
- stanford-corenlp
- ${corenlp.version}
- models
- runtime
-
-
-
-
- org.apache.logging.log4j
- log4j-api
- ${log4j.version}
-
-
- org.apache.logging.log4j
- log4j-core
- ${log4j.version}
-
-
- org.apache.logging.log4j
- log4j-slf4j-impl
- ${log4j.version}
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-shade-plugin
- 1.5
-
-
- package
-
- shade
-
-
-
-
-
-
- *:*
-
-
-
-
- reference.conf
-
-
-
- com.bensherriff.siren.Main
- ${project.artifactId}
- ${project.version}
- ${project.artifactId}
- ${project.version}
- ${project.groupId}
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/siren.png b/siren.png
new file mode 100644
index 0000000..79257fb
Binary files /dev/null and b/siren.png differ
diff --git a/src/commands/audio/mod.rs b/src/commands/audio/mod.rs
new file mode 100644
index 0000000..6d78d1d
--- /dev/null
+++ b/src/commands/audio/mod.rs
@@ -0,0 +1,174 @@
+use std::sync::Arc;
+
+use log::debug;
+
+use serenity::model::application::interaction::{InteractionResponseType, application_command::ApplicationCommandInteraction};
+use serenity::model::prelude::{GuildId, ChannelId};
+use serenity::model::user::User;
+use serenity::prelude::*;
+use songbird::{Call, Songbird};
+use songbird::input::{Restartable, Input, Metadata, error::Error as SongbirdError};
+
+pub mod pause;
+pub mod play;
+pub mod resume;
+pub mod skip;
+pub mod stop;
+pub mod volume;
+
+/// Joins a Discord voice channel.
+///
+/// # Arguments
+/// - ctx - The context of the command.
+/// - guild_id_option - The guild ID of the guild to join.
+/// - user - The user that is requesting to join the voice channel.
+///
+/// # Returns
+/// Result<(), String> - Ok if the bot successfully joined the voice channel, Err if there was an error.
+pub async fn join(ctx: &Context, guild_id_option: &Option, user: &User) -> Result<(), String> {
+ let guild_id = match guild_id_option {
+ Some(g) => g,
+ None => {
+ return Err(format!("{}", "No guild ID set"));
+ }
+ };
+
+ let channel_id = match find_voice_channel(&ctx, &guild_id, &user) {
+ Ok(channel) => channel,
+ Err(err) => return Err(format!("{}", err))
+ };
+
+ debug!("<{}> Joining channel {}", guild_id.0, channel_id);
+ let manager = get_songbird(ctx).await;
+ let (_handle_lock, success) = manager.join(guild_id.to_owned(), channel_id.to_owned()).await;
+ match success {
+ Ok(s) => Ok(s),
+ Err(err) => Err(format!("{}", err))
+ }
+}
+
+/// Leaves a Discord voice channel.
+///
+/// # Arguments
+/// - ctx - The context of the command.
+/// - guild_id_option - The guild ID of the guild to leave.
+///
+/// # Returns
+/// Result<(), String> - Ok if the bot successfully left the voice channel, Err if there was an error.
+pub async fn leave(ctx: &Context, guild_id_option: &Option) -> Result<(), String> {
+ let guild_id = match guild_id_option {
+ Some(g) => g,
+ None => {
+ return Err(format!("{}", "No guild ID set"));
+ }
+ };
+
+ let manager = get_songbird(ctx).await;
+ if manager.get(*guild_id).is_some() {
+ debug!("<{}> Disconnecting from channel", guild_id.0);
+ if let Err(e) = manager.remove(*guild_id).await {
+ return Err(format!("{}", e))
+ }
+ }
+ Ok(())
+}
+
+/// Finds the voice channel that the user is in.
+///
+/// # Arguments
+/// - ctx - The context of the command.
+/// - guild_id - The guild ID of the guild to search.
+/// - user - The user to search for.
+///
+/// # Returns
+/// Result - Ok if the user is in a voice channel, Err if the user is not in a voice channel.
+fn find_voice_channel(ctx: &Context, guild_id: &GuildId, user: &User) -> Result {
+ let guild = match guild_id.to_guild_cached(ctx.cache.to_owned()) {
+ Some(g) => g,
+ None => return Err(format!("Guild not found"))
+ };
+
+ match guild.voice_states.get(&user.id).and_then(|voice_state| voice_state.channel_id) {
+ Some(channel) => Ok(channel),
+ None => return Err(format!("User is not in a voice channel"))
+ }
+}
+
+/// Creates a response to an interaction.
+///
+/// # Arguments
+/// - ctx - The context of the command.
+/// - command - The command that was sent.
+/// - content - The content of the response.
+///
+/// # Returns
+/// Result<(), SerenityError> - Ok if the response was created successfully, Err if there was an error.
+pub async fn create_response(ctx: &Context, command: &ApplicationCommandInteraction, content: String) -> Result<(), SerenityError> {
+ command.create_interaction_response(&ctx.http, |response: &mut serenity::builder::CreateInteractionResponse<'_>| {
+ response
+ .kind(InteractionResponseType::ChannelMessageWithSource)
+ .interaction_response_data(|message: &mut serenity::builder::CreateInteractionResponseData<'_>| message.content(content))
+ }).await
+}
+
+/// Edits a response to an interaction.
+///
+/// # Arguments
+/// - ctx - The context of the command.
+/// - command - The command that was sent.
+/// - content - The content of the response.
+///
+/// # Returns
+/// Result - Ok if the response was edited successfully, Err if there was an error.
+pub async fn edit_response(ctx: &Context, command: &ApplicationCommandInteraction, content: String) -> Result {
+ command.edit_original_interaction_response(&ctx.http, |response: &mut serenity::builder::EditInteractionResponse| {
+ response.content(content)
+ }).await
+}
+
+/// Adds a song to the queue.
+///
+/// # Arguments
+/// - call - The call to add the song to.
+/// - url - The URL of the song to add.
+/// - lazy - Whether or not to lazy load the song.
+///
+/// # Returns
+/// Result - Ok if the song was added successfully, Err if there was an error.
+pub async fn add_song(call: Arc>, url: &str, lazy: bool) -> Result {
+ let source = if is_valid_url(url) {
+ Restartable::ytdl(url.to_owned(), lazy).await?
+ } else {
+ Restartable::ytdl_search(url, lazy).await?
+ };
+ let mut handler = call.lock().await;
+ let track: Input = source.into();
+ let metadata = *track.metadata.clone();
+ handler.enqueue_source(track);
+ Ok(metadata)
+}
+
+/// Checks if a string is a valid URL.
+///
+/// # Arguments
+/// - url - The string to check.
+///
+/// # Returns
+/// bool - True if the string is a valid URL, false if it is not.
+fn is_valid_url(url: &str) -> bool {
+ match url.parse::() {
+ Ok(_) => return true,
+ Err(_) => return false
+ }
+}
+
+/// Gets the Songbird voice client.
+///
+/// # Arguments
+/// - ctx - The context of the command.
+///
+/// # Returns
+/// Arc - The Songbird voice client.
+pub async fn get_songbird(ctx: &Context) -> Arc {
+ songbird::get(ctx).await.expect("Songbird Voice client placed in at initialization")
+}
diff --git a/src/commands/audio/pause.rs b/src/commands/audio/pause.rs
new file mode 100644
index 0000000..4423f67
--- /dev/null
+++ b/src/commands/audio/pause.rs
@@ -0,0 +1,43 @@
+use log::{debug, error};
+
+use serenity::prelude::*;
+use serenity::builder::CreateApplicationCommand;
+use serenity::model::application::interaction::application_command::ApplicationCommandInteraction;
+
+use super::{get_songbird, create_response, edit_response};
+
+pub async fn run(ctx: &Context, command: &ApplicationCommandInteraction) {
+ // Create the initial response
+ if let Err(why) = create_response(&ctx, &command, "Processing command...".to_string()).await {
+ error!("Failed to create response message: {}", why);
+ return;
+ }
+
+ let guild_id = match command.guild_id {
+ Some(g) => g,
+ None => {
+ if let Err(why) = edit_response(&ctx, &command, "Unable to join voice channel".to_string()).await {
+ error!("Failed to edit response message: {}", why);
+ }
+ return;
+ }
+ };
+ let manager = get_songbird(ctx).await;
+ if let Some(handler_lock) = manager.get(guild_id) {
+ let handler = handler_lock.lock().await;
+ if let Err(err) = handler.queue().pause() {
+ if let Err(why) = edit_response(&ctx, &command, format!("Failed to pause: {}", err)).await {
+ error!("Failed to edit response message: {}", why);
+ }
+ } else {
+ debug!("Paused the track");
+ if let Err(why) = edit_response(&ctx, &command, format!("Pausing the track")).await {
+ error!("Failed to edit response message: {}", why);
+ }
+ }
+ }
+}
+
+pub fn register(command: &mut CreateApplicationCommand) -> &mut CreateApplicationCommand {
+ command.name("pause").description("Pause the current track")
+}
\ No newline at end of file
diff --git a/src/commands/audio/play.rs b/src/commands/audio/play.rs
new file mode 100644
index 0000000..e98da00
--- /dev/null
+++ b/src/commands/audio/play.rs
@@ -0,0 +1,129 @@
+use log::{debug, warn, error};
+
+use serenity::{prelude::*, async_trait};
+use serenity::builder::CreateApplicationCommand;
+use serenity::model::application::interaction::application_command::ApplicationCommandInteraction;
+use songbird::EventHandler;
+
+use crate::commands::audio::{join, leave, add_song, get_songbird};
+
+use super::{create_response, edit_response};
+
+pub async fn run(ctx: &Context, command: &ApplicationCommandInteraction) {
+ // Get the track url
+ let track_url = match command.data.options.get(0) {
+ Some(t) => match &t.value {
+ Some(v) => match v.as_str() {
+ Some(s) => s.to_owned(),
+ None => {
+ warn!("Missing track option");
+ if let Err(why) = create_response(&ctx, &command, format!("Track option is missing")).await {
+ error!("Failed to create response message: {}", why);
+ }
+ return;
+ }
+ }
+ None => {
+ warn!("Missing track option");
+ if let Err(why) = create_response(&ctx, &command, format!("Track option is missing")).await {
+ error!("Failed to create response message: {}", why);
+ }
+ return;
+ }
+ }
+ None => {
+ warn!("Missing track option");
+ if let Err(why) = create_response(&ctx, &command, format!("Track option is missing")).await {
+ error!("Failed to create response message: {}", why);
+ }
+ return;
+ }
+ };
+
+ // Create the initial response
+ if let Err(why) = create_response(&ctx, &command, format!("Processing command...")).await {
+ error!("Failed to create response message: {}", why);
+ return;
+ }
+
+ match join(&ctx, &command.guild_id, &command.user).await {
+ Ok(_) => {
+ let guild_id = match command.guild_id {
+ Some(g) => g,
+ None => {
+ if let Err(why) = edit_response(&ctx, &command, "Unable to join voice channel".to_string()).await {
+ error!("Failed to edit response message: {}", why);
+ }
+ return;
+ }
+ };
+ debug!("Play command executed with track: {:?}", track_url);
+
+ let manager = get_songbird(ctx).await;
+ if let Some(handler_lock) = manager.get(guild_id) {
+ let is_queue_empty = {
+ let call_handler = handler_lock.lock().await;
+ call_handler.queue().is_empty()
+ };
+ match add_song(handler_lock.clone(), &track_url, is_queue_empty).await {
+ Ok(added_song) => {
+ let track_title = added_song.title.unwrap();
+ debug!("Added song: {}", track_title);
+ if let Err(why) = edit_response(&ctx, &command, format!("Added song to queue: {}", track_title)).await {
+ error!("Failed to edit response message: {}", why);
+ }
+ let mut handler = handler_lock.lock().await;
+ handler.remove_all_global_events();
+ handler.add_global_event(songbird::Event::Track(songbird::TrackEvent::End), TrackEndNotifier { guild_id, call: manager })
+ }
+ Err(why) => {
+ warn!("Failed to add song: {}", why);
+ if let Err(why) = edit_response(&ctx, &command, format!("Failed to add song: {}", why)).await {
+ error!("Failed to edit response message: {}", why);
+ }
+ if let Err(why) = leave(&ctx, &command.guild_id).await {
+ error!("Failed to leave voice channel: {}", why);
+ }
+ return;
+ }
+ };
+ }
+ },
+ Err(err) => {
+ warn!("{}", err);
+ if let Err(why) = edit_response(&ctx, &command, format!("{}", err)).await {
+ error!("Failed to edit response message: {}", why);
+ }
+ }
+ }
+}
+
+pub fn register(command: &mut CreateApplicationCommand) -> &mut CreateApplicationCommand {
+ command.name("play").description("Plays the given track").create_option(|option| { option
+ .name("track")
+ .description("The track to be played")
+ .kind(serenity::model::prelude::command::CommandOptionType::String)
+ .required(true)
+ })
+}
+
+struct TrackEndNotifier {
+ pub call: std::sync::Arc,
+ pub guild_id: serenity::model::id::GuildId
+}
+
+#[async_trait]
+impl EventHandler for TrackEndNotifier {
+ async fn act(&self, ctx: &songbird::events::EventContext<'_>) -> Option {
+ if let songbird::EventContext::Track(_track_list) = ctx {
+ if let Some(call) = self.call.get(self.guild_id) {
+ let mut handler = call.lock().await;
+ if handler.queue().is_empty() {
+ debug!("Queue is empty, leaving voice channel");
+ handler.leave().await.unwrap();
+ }
+ }
+ }
+ None
+ }
+}
diff --git a/src/commands/audio/resume.rs b/src/commands/audio/resume.rs
new file mode 100644
index 0000000..d97a592
--- /dev/null
+++ b/src/commands/audio/resume.rs
@@ -0,0 +1,43 @@
+use log::{debug, error};
+
+use serenity::prelude::*;
+use serenity::builder::CreateApplicationCommand;
+use serenity::model::application::interaction::application_command::ApplicationCommandInteraction;
+
+use super::{get_songbird, create_response, edit_response};
+
+pub async fn run(ctx: &Context, command: &ApplicationCommandInteraction) {
+ // Create the initial response
+ if let Err(why) = create_response(&ctx, &command, "Processing command...".to_string()).await {
+ error!("Failed to create response message: {}", why);
+ return;
+ }
+
+ let guild_id = match command.guild_id {
+ Some(g) => g,
+ None => {
+ if let Err(why) = edit_response(&ctx, &command, "Unable to join voice channel".to_string()).await {
+ error!("Failed to edit response message: {}", why);
+ }
+ return;
+ }
+ };
+ let manager = get_songbird(ctx).await;
+ if let Some(handler_lock) = manager.get(guild_id) {
+ let handler = handler_lock.lock().await;
+ if let Err(err) = handler.queue().resume() {
+ if let Err(why) = edit_response(&ctx, &command, format!("Failed to resume: {}", err)).await {
+ error!("Failed to edit response message: {}", why);
+ }
+ } else {
+ debug!("Resumed the track");
+ if let Err(why) = edit_response(&ctx, &command, format!("Resuming the track")).await {
+ error!("Failed to edit response message: {}", why);
+ }
+ }
+ }
+}
+
+pub fn register(command: &mut CreateApplicationCommand) -> &mut CreateApplicationCommand {
+ command.name("resume").description("Resume the current track")
+}
\ No newline at end of file
diff --git a/src/commands/audio/skip.rs b/src/commands/audio/skip.rs
new file mode 100644
index 0000000..cd95d91
--- /dev/null
+++ b/src/commands/audio/skip.rs
@@ -0,0 +1,43 @@
+use log::{debug, error};
+
+use serenity::prelude::*;
+use serenity::builder::CreateApplicationCommand;
+use serenity::model::application::interaction::application_command::ApplicationCommandInteraction;
+
+use super::{get_songbird, create_response, edit_response};
+
+pub async fn run(ctx: &Context, command: &ApplicationCommandInteraction) {
+ // Create the initial response
+ if let Err(why) = create_response(&ctx, &command, "Processing command...".to_string()).await {
+ error!("Failed to create response message: {}", why);
+ return;
+ }
+
+ let guild_id = match command.guild_id {
+ Some(g) => g,
+ None => {
+ if let Err(why) = edit_response(&ctx, &command, "Unable to join voice channel".to_string()).await {
+ error!("Failed to edit response message: {}", why);
+ }
+ return;
+ }
+ };
+ let manager = get_songbird(ctx).await;
+ if let Some(handler_lock) = manager.get(guild_id) {
+ let handler = handler_lock.lock().await;
+ if let Err(err) = handler.queue().skip() {
+ if let Err(why) = edit_response(&ctx, &command, format!("Failed to skip: {}", err)).await {
+ error!("Failed to edit response message: {}", why);
+ }
+ } else {
+ debug!("Skipped the track");
+ if let Err(why) = edit_response(&ctx, &command, format!("Skipping the track")).await {
+ error!("Failed to edit response message: {}", why);
+ }
+ }
+ }
+}
+
+pub fn register(command: &mut CreateApplicationCommand) -> &mut CreateApplicationCommand {
+ command.name("skip").description("Skip the current track")
+}
\ No newline at end of file
diff --git a/src/commands/audio/stop.rs b/src/commands/audio/stop.rs
new file mode 100644
index 0000000..32dec6f
--- /dev/null
+++ b/src/commands/audio/stop.rs
@@ -0,0 +1,38 @@
+use log::{debug, error};
+
+use serenity::prelude::*;
+use serenity::builder::CreateApplicationCommand;
+use serenity::model::application::interaction::application_command::ApplicationCommandInteraction;
+
+use super::{get_songbird, create_response, edit_response};
+
+pub async fn run(ctx: &Context, command: &ApplicationCommandInteraction) {
+ // Create the initial response
+ if let Err(why) = create_response(&ctx, &command, "Processing command...".to_string()).await {
+ error!("Failed to create response message: {}", why);
+ return;
+ }
+
+ let guild_id = match command.guild_id {
+ Some(g) => g,
+ None => {
+ if let Err(why) = edit_response(&ctx, &command, "Unable to join voice channel".to_string()).await {
+ error!("Failed to edit response message: {}", why);
+ }
+ return;
+ }
+ };
+ let manager = get_songbird(ctx).await;
+ if let Some(handler_lock) = manager.get(guild_id) {
+ let handler = handler_lock.lock().await;
+ handler.queue().stop();
+ debug!("Stopped the track");
+ if let Err(why) = edit_response(&ctx, &command, format!("Stopping the tracks")).await {
+ error!("Failed to edit response message: {}", why);
+ }
+ }
+}
+
+pub fn register(command: &mut CreateApplicationCommand) -> &mut CreateApplicationCommand {
+ command.name("stop").description("Stop the current track and clear the queue")
+}
\ No newline at end of file
diff --git a/src/commands/audio/volume.rs b/src/commands/audio/volume.rs
new file mode 100644
index 0000000..e69de29
diff --git a/src/commands/help.rs b/src/commands/help.rs
new file mode 100644
index 0000000..e69de29
diff --git a/src/commands/mod.rs b/src/commands/mod.rs
new file mode 100644
index 0000000..be3685c
--- /dev/null
+++ b/src/commands/mod.rs
@@ -0,0 +1,2 @@
+pub mod ping;
+pub mod audio;
\ No newline at end of file
diff --git a/src/commands/ping.rs b/src/commands/ping.rs
new file mode 100644
index 0000000..4524e09
--- /dev/null
+++ b/src/commands/ping.rs
@@ -0,0 +1,11 @@
+use log::debug;
+use serenity::{model::prelude::interaction::application_command::CommandDataOption, builder::CreateApplicationCommand};
+
+pub fn run(_options: &[CommandDataOption]) -> String {
+ debug!("Ping command executed");
+ "pong".to_string()
+}
+
+pub fn register(command: &mut CreateApplicationCommand) -> &mut CreateApplicationCommand {
+ command.name("ping").description("Replies with pong")
+}
\ No newline at end of file
diff --git a/src/main.rs b/src/main.rs
new file mode 100644
index 0000000..e4b814f
--- /dev/null
+++ b/src/main.rs
@@ -0,0 +1,104 @@
+use std::collections::HashSet;
+use std::env;
+
+use commands::audio::create_response;
+use dotenv::dotenv;
+use log::{error, warn, info};
+use serenity::async_trait;
+use serenity::framework::StandardFramework;
+use serenity::model::application::interaction::Interaction;
+use serenity::model::gateway::Ready;
+use serenity::http::Http;
+use serenity::prelude::*;
+use songbird::SerenityInit;
+
+mod commands;
+struct Handler;
+
+#[async_trait]
+impl EventHandler for Handler {
+ async fn interaction_create(&self, ctx: Context, interaction: Interaction) {
+ if let Interaction::ApplicationCommand(command) = interaction {
+ match command.data.name.as_str() {
+ "play" => commands::audio::play::run(&ctx, &command).await,
+ "stop" => commands::audio::stop::run(&ctx, &command).await,
+ "pause" => commands::audio::pause::run(&ctx, &command).await,
+ "resume" => commands::audio::resume::run(&ctx, &command).await,
+ "skip" => commands::audio::skip::run(&ctx, &command).await,
+ _ => {
+ let content: String = match command.data.name.as_str() {
+ "ping" => commands::ping::run(&command.data.options),
+ _ => "Unknown command".to_string()
+ };
+
+ if let Err(why) = create_response(&ctx, &command, content).await {
+ warn!("Cannot respond to slash command: {}", why);
+ }
+ }
+ }
+ }
+ }
+
+ async fn ready(&self, ctx: Context, ready: Ready) {
+ if ready.guilds.is_empty() {
+ warn!("No ready guilds found");
+ }
+ for guild in ready.guilds {
+ let commands = guild.id.set_application_commands(&ctx.http, |commands| {
+ commands.create_application_command(|command: &mut serenity::builder::CreateApplicationCommand| { commands::ping::register(command) })
+ .create_application_command(|command: &mut serenity::builder::CreateApplicationCommand| { commands::audio::play::register(command) })
+ .create_application_command(|command: &mut serenity::builder::CreateApplicationCommand| { commands::audio::stop::register(command) })
+ .create_application_command(|command: &mut serenity::builder::CreateApplicationCommand| { commands::audio::pause::register(command) })
+ .create_application_command(|command: &mut serenity::builder::CreateApplicationCommand| { commands::audio::resume::register(command) })
+ .create_application_command(|command: &mut serenity::builder::CreateApplicationCommand| { commands::audio::skip::register(command) })
+ }).await;
+ match commands {
+ Ok(c) => info!("Registered {} commands for guild {}", c.len(), guild.id.0),
+ Err(why) => error!("Could not register commands for guild {}: {:?}", guild.id.0, why)
+ };
+ }
+ }
+}
+
+#[tokio::main]
+async fn main() {
+ dotenv().ok();
+ env_logger::init();
+
+ let token: String = env::var("DISCORD_TOKEN").expect("Expected a token in the environment");
+ let intents: GatewayIntents = GatewayIntents::all();
+
+ let http: Http = Http::new(&token);
+ let (owners, _bot_id) = match http.get_current_application_info().await {
+ Ok(info) => {
+ let mut owners: HashSet = HashSet::new();
+ if let Some(team) = info.team {
+ owners.insert(team.owner_user_id);
+ } else {
+ owners.insert(info.owner.id);
+ }
+ match http.get_current_user().await {
+ Ok(bot) => (owners, bot.id),
+ Err(why) => panic!("Could not access the bot id: {:?}", why)
+ }
+ },
+ Err(why) => panic!("Could not access application info: {:?}", why)
+ };
+
+ let framework = StandardFramework::new()
+ .configure(|c| c
+ .owners(owners)
+ .prefix("!")
+ );
+
+ let mut client = Client::builder(token, intents)
+ .event_handler(Handler)
+ .framework(framework)
+ .register_songbird()
+ .await
+ .expect("Error creating client");
+
+ if let Err(why) = client.start_autosharded().await {
+ error!("An error occurred while running the client: {:?}", why);
+ }
+}
diff --git a/src/main/java/com/bensherriff/siren/Listener.java b/src/main/java/com/bensherriff/siren/Listener.java
deleted file mode 100644
index 54bb37b..0000000
--- a/src/main/java/com/bensherriff/siren/Listener.java
+++ /dev/null
@@ -1,194 +0,0 @@
-package com.bensherriff.siren;
-
-import com.bensherriff.siren.audio.AudioHandler;
-import com.bensherriff.siren.audio.PlayerManager;
-import com.bensherriff.siren.commands.*;
-import com.bensherriff.siren.database.DatabaseManager;
-import com.bensherriff.siren.exceptions.EmptyVoiceChannelException;
-import com.bensherriff.siren.ai.OpenAIManager;
-import com.bensherriff.siren.settings.*;
-import net.dv8tion.jda.api.JDA;
-import net.dv8tion.jda.api.entities.Guild;
-import net.dv8tion.jda.api.entities.Member;
-import net.dv8tion.jda.api.entities.channel.concrete.VoiceChannel;
-import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent;
-import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
-import net.dv8tion.jda.api.events.session.ReadyEvent;
-import net.dv8tion.jda.api.hooks.ListenerAdapter;
-import net.dv8tion.jda.api.managers.AudioManager;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-import org.jetbrains.annotations.NotNull;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.*;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.stream.Collectors;
-
-public class Listener extends ListenerAdapter {
- private static final Logger LOGGER = LogManager.getLogger(Listener.class);
- private final ScheduledExecutorService executor;
-
- private final Settings settings;
- private final Map commands = new HashMap<>();
- private final String owner;
- private PlayerManager playerManager;
- private OpenAIManager openAIManager;
- private JDA jda;
-
- public Listener(Settings settings) {
- this.settings = settings;
- this.executor = Executors.newScheduledThreadPool(this.settings.getThreadPool());
- this.owner = "@bsherriff";
- }
-
- public ScheduledExecutorService getExecutor() {
- return executor;
- }
-
- public PlayerManager getPlayerManager() {
- return playerManager;
- }
-
- public Settings getSettings() {
- return settings;
- }
-
- public String getOwner() {
- return owner;
- }
-
- public JDA getJDA() {
- return jda;
- }
-
- public void setJDA(JDA jda) {
- this.jda = jda;
- }
-
- public OpenAIManager getOpenAIManager() {
- return openAIManager;
- }
-
- public void initialize() {
- this.playerManager = new PlayerManager(this);
- this.playerManager.initialize();
- this.openAIManager = new OpenAIManager(this);
-
- DatabaseManager.createTables();
- populateAudioTable();
- }
-
- public void closeAudioConnection(long guildID) {
- Guild guild = jda.getGuildById(guildID);
- if (guild != null) {
- guild.getAudioManager().closeAudioConnection();
- }
- }
-
- public void connectToVoiceChannel(String userID, AudioManager audioManager) throws EmptyVoiceChannelException {
- if (!audioManager.isConnected()) {
- Member member = audioManager.getGuild().getMemberById(userID);
- if (member != null) {
- if (member.getVoiceState() != null && member.getVoiceState().inAudioChannel()) {
- VoiceChannel voiceChannel = Objects.requireNonNull(member.getVoiceState().getChannel()).asVoiceChannel();
- LOGGER.debug("Connecting to channel {} in guild {}", voiceChannel.getId(), voiceChannel.getGuild().getId());
- audioManager.openAudioConnection(voiceChannel);
- } else {
- throw new EmptyVoiceChannelException("Member {} is not connected to a voice channel");
- }
- }
- }
- }
-
- public synchronized AudioHandler getGuildAudioPlayer(Guild guild) throws IOException {
- long guildId = Long.parseLong(guild.getId());
- AudioHandler audioHandler;
-
- if (guild.getAudioManager().getSendingHandler() == null || !settings.getGuildSettings().containsKey(guildId)) {
- LOGGER.info("Creating Audio Handler for guild {}", guildId);
- if (!settings.getGuildSettings().containsKey(guildId)) {
- settings.getGuildSettings().put(guildId, new GuildSettings());
- SettingsManager.write(settings);
- }
- audioHandler = new AudioHandler(playerManager, guildId);
- guild.getAudioManager().setSendingHandler(audioHandler);
- } else {
- audioHandler = (AudioHandler) guild.getAudioManager().getSendingHandler();
- }
-
- return audioHandler;
- }
-
- private void populateAudioTable() {
- DatabaseManager.clearTable("audio");
- File directory = new File(SettingsManager.AUDIO_DIRECTORY);
- try {
- if (!directory.exists() && !directory.mkdirs()) {
- LOGGER.error("Failed to create directory at {}", directory.getPath());
- return;
- }
- LocalTracks tracks = SettingsManager.load(SettingsManager.TRACKS_PATH, LocalTracks.class);
- int rows = 0;
- File[] files = directory.listFiles();
- if (files != null) {
- for (LocalTrack track : tracks.getTracks()) {
- for (File file : files) {
- if (file.exists() && file.getName().equals(track.getFileName())) {
- rows += DatabaseManager.storeAudio(track);
- }
- }
- }
- }
- LOGGER.debug("Updated with {} local tracks", rows);
- } catch (IOException ex) {
- LOGGER.error("Failed to load local tracks; {}", ex.getMessage());
- }
- }
-
- @Override
- public void onReady(@NotNull ReadyEvent event) {
- super.onReady(event);
- commands.put("play", new PlayCommand(this));
- commands.put("stop", new StopCommand(this));
- commands.put("skip", new SkipCommand(this));
- commands.put("volume", new VolumeCommand(this));
- commands.put("pause", new PauseCommand(this));
- commands.put("resume", new ResumeCommand(this));
-// commands.put("image", new ImageCommand(this));
- jda.getGuilds().forEach(guild -> executor.execute(() -> {
- LOGGER.debug("Updating commands for \"{}\" <{}>", guild.getName(), guild.getId());
- guild.updateCommands().addCommands(
- commands.values().stream().map(Command::getSlashCommandData).collect(Collectors.toList())
- ).queue();
- }));
- super.onReady(event);
- }
-
- @Override
- public void onSlashCommandInteraction(@NotNull SlashCommandInteractionEvent event) {
- String command = event.getName();
- event.deferReply().queue();
-
- if (commands.containsKey(command)) {
- executor.execute(() -> {
- try {
- commands.get(command).execute(event);
- } catch (Exception ex) {
- LOGGER.error("Failed to execute command; {}", ex.getMessage());
- event.getHook().sendMessage("An error occurred while processing your command. Please contact " + owner + ".").queue();
- }
- });
- } else {
- event.getHook().sendMessage("Unexpected command received.").queue();
- }
- super.onSlashCommandInteraction(event);
- }
-
- @Override
- public void onMessageReceived(@NotNull MessageReceivedEvent event) {
- openAIManager.onMessageReceived(event);
- }
-}
diff --git a/src/main/java/com/bensherriff/siren/Main.java b/src/main/java/com/bensherriff/siren/Main.java
deleted file mode 100644
index 521f1a5..0000000
--- a/src/main/java/com/bensherriff/siren/Main.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package com.bensherriff.siren;
-
-import com.bensherriff.siren.settings.Settings;
-import com.bensherriff.siren.settings.SettingsManager;
-import net.dv8tion.jda.api.JDA;
-import net.dv8tion.jda.api.JDABuilder;
-import net.dv8tion.jda.api.entities.Activity;
-import net.dv8tion.jda.api.requests.GatewayIntent;
-import net.dv8tion.jda.api.utils.cache.CacheFlag;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-
-import java.io.IOException;
-import java.util.Arrays;
-
-public class Main {
- private static final Logger LOGGER = LogManager.getLogger(Main.class);
- private final static GatewayIntent[] INTENTS = {
- GatewayIntent.DIRECT_MESSAGES, GatewayIntent.GUILD_MESSAGES, GatewayIntent.GUILD_MESSAGE_REACTIONS,
- GatewayIntent.GUILD_VOICE_STATES, GatewayIntent.MESSAGE_CONTENT
- };
- private final static CacheFlag[] ENABLED_FLAGS = {
- CacheFlag.MEMBER_OVERRIDES, CacheFlag.VOICE_STATE
- };
- private final static CacheFlag[] DISABLED_FLAGS = {
- CacheFlag.ACTIVITY, CacheFlag.CLIENT_STATUS, CacheFlag.ONLINE_STATUS, CacheFlag.EMOJI, CacheFlag.STICKER, CacheFlag.SCHEDULED_EVENTS
- };
-
- public static void main(String[] args) {
- try {
- start();
- } catch (Exception ex) {
- LOGGER.error("Caught unhandled exception; {}", ex.getMessage());
- }
- }
-
- private static void start() throws IOException {
- Settings settings = SettingsManager.load();
- Listener listener = new Listener(settings);
-
- if (settings.getToken() == null || settings.getToken().isEmpty()) {
- throw new IOException("Token field may not be empty, please set the value in " + SettingsManager.PATH);
- } else if (settings.getOwner() == null || settings.getOwner().isEmpty()) {
- throw new IOException("Owner field may not be empty, please set the value in " + SettingsManager.PATH);
- }
-
- JDA jda = JDABuilder.create(settings.getToken(), Arrays.asList(INTENTS))
- .enableCache(Arrays.asList(ENABLED_FLAGS))
- .disableCache(Arrays.asList(DISABLED_FLAGS))
- .setActivity(Activity.playing("nothing"))
- .addEventListeners(listener)
- .setBulkDeleteSplittingEnabled(true)
- .build();
- listener.setJDA(jda);
- listener.initialize();
- }
-}
diff --git a/src/main/java/com/bensherriff/siren/ai/ImageSize.java b/src/main/java/com/bensherriff/siren/ai/ImageSize.java
deleted file mode 100644
index 0540580..0000000
--- a/src/main/java/com/bensherriff/siren/ai/ImageSize.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.bensherriff.siren.ai;
-
-public enum ImageSize {
- SMALL("256x256"),
- MEDIUM("512x512"),
- LARGE("1024x1024");
-
- private final String size;
-
- ImageSize(String size) {
- this.size = size;
- }
-
- public String getSize() {
- return size;
- }
-}
diff --git a/src/main/java/com/bensherriff/siren/ai/Model.java b/src/main/java/com/bensherriff/siren/ai/Model.java
deleted file mode 100644
index f3338d1..0000000
--- a/src/main/java/com/bensherriff/siren/ai/Model.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package com.bensherriff.siren.ai;
-
-/**
- * CompletionRequest Models:
- * text-davinci-003, text-davinci-002, text-curie-001, text-babbage-001, text-ada-001
- * ChatCompletionRequest Models:
- * gpt-4, gpt-4-0314, gpt-4-32k, gpt-4-32k-0314, gpt-3.5-turbo, gpt-3.5-turbo-0301
- */
-public enum Model {
- DAVINCI_3("text-davinci-003"),
- DAVINCI_2("text-davinci-002"),
- CURIE_1("text-curie-001"),
- BABBAGE_1("text-babbage-001"),
- ADA_1("text-ada-001"),
- GPT_4("gpt-4"),
- GPT_4_32K("gpt-4-32k"),
- GPT_35_TURBO("gpt-3.5-turbo"),
- ADA_EMBEDDING_2("text-embedding-ada-002")
- ;
-
- private final String name;
- Model(String name) {
- this.name = name;
- }
-
- public String getName() {
- return name;
- }
-}
diff --git a/src/main/java/com/bensherriff/siren/ai/NLP.java b/src/main/java/com/bensherriff/siren/ai/NLP.java
deleted file mode 100644
index b2e3a26..0000000
--- a/src/main/java/com/bensherriff/siren/ai/NLP.java
+++ /dev/null
@@ -1,121 +0,0 @@
-package com.bensherriff.siren.ai;
-
-import edu.stanford.nlp.ling.CoreAnnotations;
-import edu.stanford.nlp.ling.CoreLabel;
-import edu.stanford.nlp.pipeline.Annotation;
-import edu.stanford.nlp.pipeline.StanfordCoreNLP;
-import edu.stanford.nlp.sentiment.SentimentCoreAnnotations;
-import edu.stanford.nlp.util.CoreMap;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-
-import java.util.*;
-
-public class NLP {
- private static final Logger LOGGER = LogManager.getLogger(NLP.class);
- private final StanfordCoreNLP pipeline;
- private final Map> keywords;
-
- public NLP() {
- Properties props = new Properties();
- props.setProperty("annotators", "tokenize, ssplit, pos, lemma, ner, parse, dcoref, sentiment");
- pipeline = new StanfordCoreNLP(props);
- keywords = new HashMap<>();
- keywords.put("dnd", Arrays.asList("dnd", "dungeons", "dragons", "sorcerer", "warlock", "cleric", "fighter", "rogue", "bard", "wizard", "paladin", "ranger", "druid"));
- }
-
- private List getSentences(String text) {
- Annotation annotation = new Annotation(text);
- pipeline.annotate(annotation);
- return annotation.get(CoreAnnotations.SentencesAnnotation.class);
- }
-
- public Set getTags(String text) {
- Set tags = new LinkedHashSet<>();
-
- List sentences = getSentences(text);
- for (CoreMap sentence : sentences) {
- List tokens = sentence.get(CoreAnnotations.TokensAnnotation.class);
- List namedEntities = new ArrayList<>();
-
- for (CoreLabel token : tokens) {
- String ne = token.get(CoreAnnotations.NamedEntityTagAnnotation.class);
- if (!ne.equals("0")) {
- namedEntities.add(token);
- }
- if (token.equals(tokens.get(tokens.size() - 1)) && token.word().equals("?") ||
- (List.of("what", "when", "who", "where", "why", "how").contains(token.word()))) {
- tags.add("question");
- }
- }
-
- for (CoreLabel namedEntity : namedEntities) {
- String ne = namedEntity.get(CoreAnnotations.NamedEntityTagAnnotation.class);
- String word = namedEntity.word();
- if (ne.equals("PERSON") || ne.equals("ORGANIZATION")) {
- tags.add(word);
- } else if (ne.equals("LOCATION")) {
- String[] posTags = word.split("_");
- for (String posTag : posTags) {
- if (posTag.startsWith("N")) {
- tags.add(word);
- break;
- }
- }
- } else {
- String pos = namedEntity.get(CoreAnnotations.PartOfSpeechAnnotation.class);
- if (pos.startsWith("NN")) {
- tags.add(word);
- for (String keyword : keywords.keySet()) {
- if (keywords.get(keyword).contains(word.toLowerCase())) {
- tags.add(keyword);
- }
- }
- }
- }
- }
- }
- return tags;
- }
-
- public List lemmatize(String documentText) {
- List lemmas = new ArrayList<>();
- Annotation document = new Annotation(documentText);
- pipeline.annotate(document);
- List sentences = document.get(CoreAnnotations.SentencesAnnotation.class);
- for (CoreMap sentence : sentences) {
- for (CoreLabel token : sentence.get(CoreAnnotations.TokensAnnotation.class)) {
- lemmas.add(token.get(CoreAnnotations.LemmaAnnotation.class));
- }
- }
- return lemmas;
- }
-
- /**
- * Determines the sentiment (tone) of each sentence in the text. For example: positive, negative, or neutral
- * @param text the input text
- * @return the list of sentiments
- */
- public List sentimentAnalysis(String text) {
- Annotation document = new Annotation(text);
- pipeline.annotate(document);
- List sentences = document.get(CoreAnnotations.SentencesAnnotation.class);
- List sentiments = new ArrayList<>();
- for (CoreMap sentence : sentences) {
- sentiments.add(sentence.get(SentimentCoreAnnotations.SentimentClass.class));
- }
- return sentiments;
- }
-
- public static double cosineSimilarity(double[] vector1, double[] vector2) {
- double dotProduct = 0.0;
- double norm1 = 0.0;
- double norm2 = 0.0;
- for (int i = 0; i < vector1.length; i++) {
- dotProduct += vector1[i] * vector2[i];
- norm1 += Math.pow(vector1[i], 2);
- norm2 += Math.pow(vector2[i], 2);
- }
- return dotProduct / (Math.sqrt(norm1) * Math.sqrt(norm2));
- }
-}
diff --git a/src/main/java/com/bensherriff/siren/ai/OpenAIManager.java b/src/main/java/com/bensherriff/siren/ai/OpenAIManager.java
deleted file mode 100644
index 8cb850c..0000000
--- a/src/main/java/com/bensherriff/siren/ai/OpenAIManager.java
+++ /dev/null
@@ -1,282 +0,0 @@
-package com.bensherriff.siren.ai;
-
-import com.bensherriff.siren.Listener;
-import com.bensherriff.siren.database.DatabaseManager;
-import com.bensherriff.siren.database.MessageData;
-import com.bensherriff.siren.database.QueryBuilder;
-import com.bensherriff.siren.settings.*;
-import com.theokanning.openai.completion.CompletionRequest;
-import com.theokanning.openai.completion.CompletionResult;
-import com.theokanning.openai.completion.chat.ChatCompletionRequest;
-import com.theokanning.openai.completion.chat.ChatCompletionResult;
-import com.theokanning.openai.completion.chat.ChatMessage;
-import com.theokanning.openai.embedding.EmbeddingRequest;
-import com.theokanning.openai.image.CreateImageRequest;
-import com.theokanning.openai.image.ImageResult;
-import com.theokanning.openai.service.OpenAiService;
-import net.dv8tion.jda.api.JDA;
-import net.dv8tion.jda.api.entities.Message;
-import net.dv8tion.jda.api.entities.MessageType;
-import net.dv8tion.jda.api.entities.channel.concrete.ThreadChannel;
-import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-
-import java.sql.SQLException;
-import java.time.Duration;
-import java.util.*;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.stream.Collectors;
-
-public class OpenAIManager {
- private static final Logger LOGGER = LogManager.getLogger(OpenAIManager.class);
- private final OpenAiService openAiService;
- private final Settings settings;
- private final JDA jda;
- private final ScheduledExecutorService executor;
- private final String owner;
- private final NLP NLP;
-
- public OpenAIManager(Listener listener) {
- this.settings = listener.getSettings();
- this.jda = listener.getJDA();
- this.executor = listener.getExecutor();
- this.owner = listener.getOwner();
- this.NLP = new NLP();
-
- if (settings.getOpenAISettings().getToken().isEmpty()) {
- LOGGER.warn("No OpenAI token; OpenAI functionality is disabled");
- openAiService = null;
- } else {
- openAiService = new OpenAiService(settings.getOpenAISettings().getToken(),
- Duration.ofMillis(listener.getSettings().getOpenAISettings().getTimeout()));
- }
- }
-
- /**
- * Handle responses when talking to the bot.
- * @param event The message event received
- */
- public void onMessageReceived(MessageReceivedEvent event) {
- if (shouldReply(event)) {
- if (openAiService != null) {
- executor.execute(() -> sendMessage(event));
- } else {
- event.getMessage().reply("OpenAI functionality is disabled. Please contact " + owner + ".").queue();
- }
- }
- }
-
- private void sendMessage(MessageReceivedEvent event) {
- String message = parseMessage(event.getMessage().getContentRaw());
-
- if (message.isEmpty() || message.isBlank()) {
- event.getMessage().reply("Your message is empty. Please try again").queue();
- return;
- }
-
- try {
- StringBuilder stringBuilder = new StringBuilder();
- long guildId = event.getGuild().getIdLong();
- long authorId = event.getAuthor().getIdLong();
- UserSettings userSettings = new UserSettings();
- settings.getGuildSettings().get(guildId).getUserSettings().putIfAbsent(authorId, userSettings);
- SettingsManager.write(settings);
- userSettings = settings.getGuildSettings().get(guildId).getUserSettings().get(authorId);
- Model model = userSettings.getModel();
- ChatMessage chatMessage = createUserMessage(message);
-
-
- LOGGER.trace("Guild: <{}> User: <{}> Message <{}>: {}", guildId, authorId, event.getMessageId(), message);
- String query = new QueryBuilder("messages")
- .where("guild_id = ? AND channel_id = ? AND prompt = ?")
- .orderBy("timestamp DESC")
- .build();
- List messages = DatabaseManager.parseResponse(DatabaseManager.query(query,
- guildId, event.getChannel().getIdLong(), chatMessage.getContent()));
- if (!messages.isEmpty()) {
- stringBuilder.append(messages.get(0).getResponse());
- } else {
- // Send OpenAI Message and get response
- switch (model) {
- case DAVINCI_3, DAVINCI_2, CURIE_1, BABBAGE_1, ADA_1 -> {
- CompletionRequest completionRequest = createCompletionRequest(message, event);
- CompletionResult completionResult = openAiService.createCompletion(completionRequest);
- completionResult.getChoices().forEach(choice -> stringBuilder.append(choice.getText().trim()));
- }
- case GPT_4, GPT_4_32K, GPT_35_TURBO -> {
- ChatCompletionRequest chatCompletionRequest = createCompletionRequest(chatMessage, event);
- ChatCompletionResult chatCompletionResult = openAiService.createChatCompletion(chatCompletionRequest);
- chatCompletionResult.getChoices().forEach(choice -> stringBuilder.append(choice.getMessage().getContent().trim()));
- }
- default -> {
- event.getMessage().reply("Unexpected model in settings. Please contact " + owner + ".").queue();
- LOGGER.warn("Unexpected model in settings for guild {}: {}. Expected one of {}", guildId,
- model, Arrays.toString(Model.values()));
- return;
- }
- }
- }
- handleResponse(chatMessage, event, stringBuilder.toString());
- } catch (Exception ex) {
- LOGGER.error("Caught exception while processing message; {}", ex.getMessage());
- event.getMessage().reply("An error occurred while processing your message. Please contact " + owner + ".").queue();
- }
- }
-
- private EmbeddingRequest createEmbeddingRequest(List chatMessages, MessageReceivedEvent event) {
- return EmbeddingRequest.builder()
- .model(Model.ADA_EMBEDDING_2.getName())
- .user(event.getAuthor().getId())
- .input(chatMessages.stream().map(ChatMessage::getContent).collect(Collectors.toList()))
- .build();
- }
-
- public ImageResult createImage(String prompt, int count, ImageSize imageSize) {
- LOGGER.trace("Generating {} image(s) of size {} with prompt <{}>", count, imageSize.getSize(), prompt);
- return openAiService.createImage(CreateImageRequest.builder()
- .prompt(prompt)
- .size(imageSize.getSize())
- .n(count <= 0 ? 1 : Math.min(count, 3))
- .build());
- }
-
- private ChatCompletionRequest createCompletionRequest(ChatMessage chatMessage, MessageReceivedEvent event) throws SQLException {
- UserSettings userSettings = settings.getGuildSettings().get(event.getGuild().getIdLong())
- .getUserSettings().get(event.getAuthor().getIdLong());
- List chatMessages = new ArrayList<>();
-// List previousMessages = getPreviousMessages(event);
-// for (MessageData previousMessage : previousMessages) {
-// chatMessages.add(createSystemMessage("In a previous conversation, we discussed the topics " + previousMessage.getTags() +
-// " and " + previousMessage.getResponseTags()));
-// chatMessages.add(createSystemMessage("I sent you the prompt \"" + previousMessage.getPrompt() +
-// "\" and you replied with \"" + previousMessage.getResponse() + "\""));
-// }
- chatMessages.add(chatMessage);
-
- // Handle System Messages
- chatMessages.add(createSystemMessage("You are a discord bot named Siren"));
- chatMessages.add(createSystemMessage("My name is " + event.getAuthor().getName()));
-
- return ChatCompletionRequest.builder()
- .model(userSettings.getModel().getName())
- .maxTokens(userSettings.getMaxTokens())
- .user(event.getAuthor().getId())
- .temperature(settings.getOpenAISettings().getTemperature())
-// .topP(settings.getOpenAISettings().getTopP())
- .frequencyPenalty(settings.getOpenAISettings().getFrequencyPenalty())
- .presencePenalty(settings.getOpenAISettings().getPresencePenalty())
- .messages(chatMessages)
- .build();
- }
-
- private List getPreviousMessages(MessageReceivedEvent event) throws SQLException {
- List previousMessages = new ArrayList<>();
- if (event.isFromThread()) {
- String query = new QueryBuilder("messages")
- .where("guild_id = ? AND channel_id = ?")
- .orderBy("timestamp DESC")
- .limit(3)
- .build();
-
- // Build MessageData objects from query results
- List