diff --git a/main.rs b/main.rs index 20c2519..0b4679c 100644 --- a/main.rs +++ b/main.rs @@ -51,7 +51,15 @@ async fn event_handler( println!("Logged in as {}", data_about_bot.user.name); } - serenity::FullEvent::VoiceStateUpdate { old: _, new } => { + serenity::FullEvent::VoiceStateUpdate { old, new } => { + // old があるかつ old channel と new channel が一致していたら何もしない + if old + .as_ref() + .is_some_and(|old| old.channel_id == new.channel_id) + { + return Ok(()); + } + let Some(new_channel_id) = new.channel_id else { return Ok(()); };