Slight refactoring to reduce indentation
This commit is contained in:
parent
9f713a6463
commit
a4ddf32b73
|
@ -18,8 +18,11 @@ impl EventHandler for Handler {
|
|||
old: Option<VoiceState>,
|
||||
new: VoiceState,
|
||||
) {
|
||||
if let Some(gid) = guild_id {
|
||||
if let Some(rid) = ROLES_BY_SERVER.get(&gid) {
|
||||
if guild_id.is_none() || !ROLES_BY_SERVER.contains_key(&guild_id.unwrap()) {
|
||||
return;
|
||||
}
|
||||
let gid = guild_id.unwrap();
|
||||
let rid = ROLES_BY_SERVER.get(&gid).unwrap();
|
||||
if let Ok(guild) = PartialGuild::get(&ctx.http, gid) {
|
||||
let mut roles = guild
|
||||
.member(&ctx.http, new.user_id)
|
||||
|
@ -40,8 +43,6 @@ impl EventHandler for Handler {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lazy_static! {
|
||||
|
|
Loading…
Reference in New Issue
Block a user