Fix compiling with latest serenity (#199)

This commit is contained in:
Gnome!
2023-10-09 03:22:45 +01:00
committed by Kyle Simpson
parent 935171df4f
commit 509743fd40
4 changed files with 14 additions and 18 deletions

View File

@@ -45,7 +45,7 @@ impl From<NonZeroU64> for ChannelId {
#[cfg(feature = "serenity")]
impl From<SerenityChannel> for ChannelId {
fn from(id: SerenityChannel) -> Self {
Self(id.0)
Self(NonZeroU64::new(id.get()).unwrap())
}
}
@@ -71,7 +71,7 @@ impl From<NonZeroU64> for GuildId {
#[cfg(feature = "serenity")]
impl From<SerenityGuild> for GuildId {
fn from(id: SerenityGuild) -> Self {
Self(id.0)
Self(NonZeroU64::new(id.get()).unwrap())
}
}
@@ -104,7 +104,7 @@ impl From<NonZeroU64> for UserId {
#[cfg(feature = "serenity")]
impl From<SerenityUser> for UserId {
fn from(id: SerenityUser) -> Self {
Self(id.0)
Self(NonZeroU64::new(id.get()).unwrap())
}
}

View File

@@ -443,11 +443,9 @@ impl VoiceGatewayManager for Songbird {
}
async fn state_update(&self, guild_id: SerenityGuild, voice_state: &VoiceState) {
if self
.client_data
.get()
.map_or(true, |data| voice_state.user_id.0 != data.user_id.0)
{
if self.client_data.get().map_or(true, |data| {
voice_state.user_id.get() != data.user_id.0.get()
}) {
return;
}