Deps: Bump twilight versions -> 0.5 (#79)
This commit is contained in:
committed by
Kyle Simpson
parent
00c8bc915a
commit
d6d6acabe1
10
Cargo.toml
10
Cargo.toml
@@ -103,12 +103,12 @@ default-features = false
|
||||
|
||||
[dependencies.twilight-gateway]
|
||||
optional = true
|
||||
version = "0.4"
|
||||
version = "0.5"
|
||||
default-features = false
|
||||
|
||||
[dependencies.twilight-model]
|
||||
optional = true
|
||||
version = "0.4"
|
||||
version = "0.5"
|
||||
default-features = false
|
||||
|
||||
[dependencies.typemap_rev]
|
||||
@@ -186,8 +186,8 @@ serenity-native = ["serenity/native_tls_backend", "native", "gateway", "serenity
|
||||
twilight-rustls = ["twilight", "twilight-gateway/rustls", "rustls", "gateway"]
|
||||
twilight-native = ["twilight", "twilight-gateway/native", "native", "gateway"]
|
||||
twilight = ["twilight-model"]
|
||||
simd-zlib = ["twilight-gateway/simd-zlib"]
|
||||
stock-zlib = ["twilight-gateway/stock-zlib"]
|
||||
zlib-simd = ["twilight-gateway/zlib-simd"]
|
||||
zlib-stock = ["twilight-gateway/zlib-stock"]
|
||||
serenity-deps = ["async-trait"]
|
||||
|
||||
rustls-marker = []
|
||||
@@ -224,7 +224,7 @@ youtube-dlc = []
|
||||
builtin-queue = []
|
||||
|
||||
# Used for docgen/testing/benchmarking.
|
||||
full-doc = ["default", "twilight-rustls", "builtin-queue", "stock-zlib"]
|
||||
full-doc = ["default", "twilight-rustls", "builtin-queue", "zlib-stock"]
|
||||
internals = []
|
||||
|
||||
[[bench]]
|
||||
|
||||
6
build.rs
6
build.rs
@@ -14,13 +14,13 @@ compile_error!(
|
||||
|
||||
#[cfg(all(
|
||||
feature = "twilight",
|
||||
not(any(feature = "simd-zlib", feature = "stock-zlib"))
|
||||
not(any(feature = "zlib-simd", feature = "zlib-stock"))
|
||||
))]
|
||||
compile_error!(
|
||||
"Twilight requires you to specify a zlib backend: \
|
||||
either the `simd-zlib` or `stock-zlib` feature must be
|
||||
either the `zlib-simd` or `zlib-stock` feature must be
|
||||
selected.\n\
|
||||
If you are unsure, go with `stock-zlib`."
|
||||
If you are unsure, go with `zlib-stock`."
|
||||
);
|
||||
|
||||
fn main() {}
|
||||
|
||||
@@ -10,12 +10,12 @@ tracing = "0.1"
|
||||
tracing-subscriber = "0.2"
|
||||
serde_json = { version = "1" }
|
||||
tokio = { features = ["macros", "rt-multi-thread", "sync"], version = "1" }
|
||||
twilight-gateway = "0.4"
|
||||
twilight-http = "0.4"
|
||||
twilight-model = "0.4"
|
||||
twilight-standby = "0.4"
|
||||
twilight-gateway = "0.5"
|
||||
twilight-http = "0.5"
|
||||
twilight-model = "0.5"
|
||||
twilight-standby = "0.5"
|
||||
|
||||
[dependencies.songbird]
|
||||
path = "../.."
|
||||
default-features = false
|
||||
features = ["twilight-rustls", "gateway", "driver", "stock-zlib"]
|
||||
features = ["twilight-rustls", "gateway", "driver", "zlib-stock"]
|
||||
|
||||
@@ -57,15 +57,16 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
|
||||
// Initialize the tracing subscriber.
|
||||
tracing_subscriber::fmt::init();
|
||||
|
||||
let state = {
|
||||
let token = env::var("DISCORD_TOKEN")?;
|
||||
|
||||
let http = HttpClient::new(&token);
|
||||
let user_id = http.current_user().await?.id;
|
||||
|
||||
let cluster =
|
||||
let (cluster, mut events) =
|
||||
Cluster::new(token, Intents::GUILD_MESSAGES | Intents::GUILD_VOICE_STATES).await?;
|
||||
|
||||
let state = {
|
||||
let user_id = http.current_user().await?.id;
|
||||
|
||||
let shard_count = cluster.shards().len();
|
||||
let songbird = Songbird::twilight(cluster.clone(), shard_count as u64, user_id);
|
||||
|
||||
@@ -80,8 +81,6 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
|
||||
}
|
||||
};
|
||||
|
||||
let mut events = state.cluster.events();
|
||||
|
||||
while let Some(event) = events.next().await {
|
||||
state.standby.process(&event.1);
|
||||
state.songbird.process(&event.1).await;
|
||||
|
||||
Reference in New Issue
Block a user