diff --git a/Cargo.toml b/Cargo.toml index 1acd1f375..a209b7b83 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -106,12 +106,12 @@ default-features = false [dependencies.twilight-gateway] optional = true -version = "0.8" +version = "0.9" default-features = false [dependencies.twilight-model] optional = true -version = "0.8" +version = "0.9" default-features = false [dependencies.typemap_rev] @@ -186,7 +186,7 @@ rustls = ["async-tungstenite/tokio-rustls-webpki-roots", "rustls-marker"] native = ["async-tungstenite/tokio-native-tls", "native-marker"] serenity-rustls = ["serenity/rustls_backend", "rustls", "gateway", "serenity-deps"] serenity-native = ["serenity/native_tls_backend", "native", "gateway", "serenity-deps"] -twilight-rustls = ["twilight", "twilight-gateway/rustls", "rustls", "gateway"] +twilight-rustls = ["twilight", "twilight-gateway/rustls-native-roots", "rustls", "gateway"] twilight-native = ["twilight", "twilight-gateway/native", "native", "gateway"] twilight = ["twilight-model"] zlib-simd = ["twilight-gateway/zlib-simd"] diff --git a/examples/twilight/Cargo.toml b/examples/twilight/Cargo.toml index de3ebad59..9a09b0e2e 100644 --- a/examples/twilight/Cargo.toml +++ b/examples/twilight/Cargo.toml @@ -9,10 +9,10 @@ futures = "0.3" tracing = "0.1" tracing-subscriber = "0.2" tokio = { features = ["macros", "rt-multi-thread", "sync"], version = "1" } -twilight-gateway = "0.8" -twilight-http = "0.8" -twilight-model = "0.8" -twilight-standby = "0.8" +twilight-gateway = "0.9" +twilight-http = "0.9" +twilight-model = "0.9" +twilight-standby = "0.9" [dependencies.songbird] default-features = false diff --git a/examples/twilight/src/main.rs b/examples/twilight/src/main.rs index 44d94df10..9153fcbfc 100644 --- a/examples/twilight/src/main.rs +++ b/examples/twilight/src/main.rs @@ -30,7 +30,11 @@ use std::{collections::HashMap, env, error::Error, future::Future, sync::Arc}; use tokio::sync::RwLock; use twilight_gateway::{Cluster, Event, Intents}; use twilight_http::Client as HttpClient; -use twilight_model::{channel::Message, gateway::payload::incoming::MessageCreate, id::GuildId}; +use twilight_model::{ + channel::Message, + gateway::payload::incoming::MessageCreate, + id::{marker::GuildMarker, Id}, +}; use twilight_standby::Standby; type State = Arc; @@ -38,7 +42,7 @@ type State = Arc; #[derive(Debug)] struct StateRef { http: HttpClient, - trackdata: RwLock>, + trackdata: RwLock, TrackHandle>>, songbird: Songbird, standby: Standby, } diff --git a/src/id.rs b/src/id.rs index 0a2c1b63c..58ab10481 100644 --- a/src/id.rs +++ b/src/id.rs @@ -11,9 +11,8 @@ use serenity::model::id::{ use std::fmt::{Display, Formatter, Result as FmtResult}; #[cfg(feature = "twilight")] use twilight_model::id::{ - ChannelId as TwilightChannel, - GuildId as TwilightGuild, - UserId as TwilightUser, + marker::{ChannelMarker, GuildMarker, UserMarker}, + Id as TwilightId, }; /// ID of a Discord voice/text channel. @@ -48,9 +47,9 @@ impl From for ChannelId { } #[cfg(feature = "twilight")] -impl From for ChannelId { - fn from(id: TwilightChannel) -> Self { - Self(id.0.into()) +impl From> for ChannelId { + fn from(id: TwilightId) -> Self { + Self(id.get().into()) } } @@ -81,9 +80,9 @@ impl From for DriverGuild { } #[cfg(feature = "twilight")] -impl From for GuildId { - fn from(id: TwilightGuild) -> Self { - Self(id.0.into()) +impl From> for GuildId { + fn from(id: TwilightId) -> Self { + Self(id.get().into()) } } @@ -114,8 +113,8 @@ impl From for DriverUser { } #[cfg(feature = "twilight")] -impl From for UserId { - fn from(id: TwilightUser) -> Self { - Self(id.0.into()) +impl From> for UserId { + fn from(id: TwilightId) -> Self { + Self(id.get().into()) } } diff --git a/src/manager.rs b/src/manager.rs index 330f41d0c..1733e1efe 100644 --- a/src/manager.rs +++ b/src/manager.rs @@ -378,7 +378,7 @@ impl Songbird { } }, TwilightEvent::VoiceStateUpdate(v) => { - if v.0.user_id.0.get() != self.client_data.read().user_id.0 { + if v.0.user_id.get() != self.client_data.read().user_id.0 { return; } diff --git a/src/shards.rs b/src/shards.rs index cf0da54a3..92613ab23 100644 --- a/src/shards.rs +++ b/src/shards.rs @@ -20,10 +20,7 @@ use tracing::{debug, error}; #[cfg(feature = "twilight")] use twilight_gateway::{Cluster, Shard as TwilightShard}; #[cfg(feature = "twilight")] -use twilight_model::{ - gateway::payload::outgoing::update_voice_state::UpdateVoiceState as TwilightVoiceState, - id::ChannelId as TwilightChannel, -}; +use twilight_model::gateway::payload::outgoing::update_voice_state::UpdateVoiceState as TwilightVoiceState; #[derive(Derivative)] #[derivative(Debug)] @@ -191,14 +188,14 @@ impl VoiceUpdate for Shard { }, #[cfg(feature = "twilight")] Shard::TwilightCluster(handle, shard_id) => { - let channel_id = nz_channel_id.map(TwilightChannel); + let channel_id = nz_channel_id.map(From::from); let cmd = TwilightVoiceState::new(nz_guild_id, channel_id, self_deaf, self_mute); handle.command(*shard_id, &cmd).await?; Ok(()) }, #[cfg(feature = "twilight")] Shard::TwilightShard(handle) => { - let channel_id = nz_channel_id.map(TwilightChannel); + let channel_id = nz_channel_id.map(From::from); let cmd = TwilightVoiceState::new(nz_guild_id, channel_id, self_deaf, self_mute); handle.command(&cmd).await?; Ok(())