We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ddb81e2 commit 4ba79faCopy full SHA for 4ba79fa
main.rs
@@ -51,7 +51,15 @@ async fn event_handler(
51
println!("Logged in as {}", data_about_bot.user.name);
52
}
53
54
- serenity::FullEvent::VoiceStateUpdate { old: _, new } => {
+ serenity::FullEvent::VoiceStateUpdate { old, new } => {
55
+ // old があるかつ old channel と new channel が一致していたら何もしない
56
+ if old
57
+ .as_ref()
58
+ .is_some_and(|old| old.channel_id == new.channel_id)
59
+ {
60
+ return Ok(());
61
+ }
62
+
63
let Some(new_channel_id) = new.channel_id else {
64
return Ok(());
65
};
0 commit comments