Fix compiling with latest serenity (#199)
This commit is contained in:
@@ -31,7 +31,8 @@ use serenity::{
|
|||||||
framework::{
|
framework::{
|
||||||
standard::{
|
standard::{
|
||||||
macros::{command, group},
|
macros::{command, group},
|
||||||
Args, CommandResult,
|
Args,
|
||||||
|
CommandResult,
|
||||||
},
|
},
|
||||||
StandardFramework,
|
StandardFramework,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -234,16 +234,13 @@ async fn main() {
|
|||||||
#[command]
|
#[command]
|
||||||
#[only_in(guilds)]
|
#[only_in(guilds)]
|
||||||
async fn join(ctx: &Context, msg: &Message, mut args: Args) -> CommandResult {
|
async fn join(ctx: &Context, msg: &Message, mut args: Args) -> CommandResult {
|
||||||
let connect_to = match args.single::<std::num::NonZeroU64>() {
|
let Ok(connect_to) = args.single::<ChannelId>() else {
|
||||||
Ok(id) => ChannelId(id),
|
check_msg(
|
||||||
Err(_) => {
|
msg.reply(ctx, "Requires a valid voice channel ID be given")
|
||||||
check_msg(
|
.await,
|
||||||
msg.reply(ctx, "Requires a valid voice channel ID be given")
|
);
|
||||||
.await,
|
|
||||||
);
|
|
||||||
|
|
||||||
return Ok(());
|
return Ok(());
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let guild_id = msg.guild_id.unwrap();
|
let guild_id = msg.guild_id.unwrap();
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ impl From<NonZeroU64> for ChannelId {
|
|||||||
#[cfg(feature = "serenity")]
|
#[cfg(feature = "serenity")]
|
||||||
impl From<SerenityChannel> for ChannelId {
|
impl From<SerenityChannel> for ChannelId {
|
||||||
fn from(id: SerenityChannel) -> Self {
|
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")]
|
#[cfg(feature = "serenity")]
|
||||||
impl From<SerenityGuild> for GuildId {
|
impl From<SerenityGuild> for GuildId {
|
||||||
fn from(id: SerenityGuild) -> Self {
|
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")]
|
#[cfg(feature = "serenity")]
|
||||||
impl From<SerenityUser> for UserId {
|
impl From<SerenityUser> for UserId {
|
||||||
fn from(id: SerenityUser) -> Self {
|
fn from(id: SerenityUser) -> Self {
|
||||||
Self(id.0)
|
Self(NonZeroU64::new(id.get()).unwrap())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -443,11 +443,9 @@ impl VoiceGatewayManager for Songbird {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn state_update(&self, guild_id: SerenityGuild, voice_state: &VoiceState) {
|
async fn state_update(&self, guild_id: SerenityGuild, voice_state: &VoiceState) {
|
||||||
if self
|
if self.client_data.get().map_or(true, |data| {
|
||||||
.client_data
|
voice_state.user_id.get() != data.user_id.0.get()
|
||||||
.get()
|
}) {
|
||||||
.map_or(true, |data| voice_state.user_id.0 != data.user_id.0)
|
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user