Gateway: Twilight v0.9 support (#110)

This handles twilight's migration to a unified `Id` type, which is the only design change needing any handling on our part. All our `From`/`Into`s are covered now, and deprecated type aliases are no longer used.

This was tested using `cargo make ready` and by manually running "examples/twilight".
This commit is contained in:
Kyle Simpson
2022-01-24 14:39:30 +00:00
parent b4ce84546b
commit 0730a00dc7
6 changed files with 28 additions and 28 deletions

View File

@@ -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(())