forked from Skynet/discord-bot
fmt: fmt and clippy
This commit is contained in:
parent
11240914ac
commit
f3ef03a418
3 changed files with 49 additions and 54 deletions
|
@ -51,7 +51,6 @@ pub async fn run(command: &ApplicationCommandInteraction, ctx: &Context) -> Stri
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
let bot_channel_id = if let CommandDataOptionValue::Channel(channel) = command
|
let bot_channel_id = if let CommandDataOptionValue::Channel(channel) = command
|
||||||
.data
|
.data
|
||||||
.options
|
.options
|
||||||
|
@ -66,7 +65,6 @@ pub async fn run(command: &ApplicationCommandInteraction, ctx: &Context) -> Stri
|
||||||
return "Please provide a valid channel for ``Bot Channel``".to_string();
|
return "Please provide a valid channel for ``Bot Channel``".to_string();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
let server_name = if let CommandDataOptionValue::String(name) = command
|
let server_name = if let CommandDataOptionValue::String(name) = command
|
||||||
.data
|
.data
|
||||||
.options
|
.options
|
||||||
|
|
|
@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};
|
||||||
use serenity::{
|
use serenity::{
|
||||||
model::{
|
model::{
|
||||||
guild,
|
guild,
|
||||||
id::{GuildId, RoleId, ChannelId},
|
id::{ChannelId, GuildId, RoleId},
|
||||||
},
|
},
|
||||||
prelude::TypeMapKey,
|
prelude::TypeMapKey,
|
||||||
};
|
};
|
||||||
|
@ -409,13 +409,11 @@ pub mod set_roles {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if !member.roles.contains(role_current) {
|
if !member.roles.contains(role_current) {
|
||||||
roles_set[1] += 1;
|
roles_set[1] += 1;
|
||||||
roles.push(role_current.to_owned());
|
roles.push(role_current.to_owned());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if let Err(e) = member.add_roles(ctx, &roles).await {
|
if let Err(e) = member.add_roles(ctx, &roles).await {
|
||||||
println!("{:?}", e);
|
println!("{:?}", e);
|
||||||
}
|
}
|
||||||
|
@ -428,7 +426,6 @@ pub mod set_roles {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if member.roles.contains(role_current) {
|
if member.roles.contains(role_current) {
|
||||||
roles_set[2] += 1;
|
roles_set[2] += 1;
|
||||||
// if theya re not a current member and have the role then remove it
|
// if theya re not a current member and have the role then remove it
|
||||||
|
|
Loading…
Reference in a new issue