diff --git a/bot/src/commands.rs b/bot/src/commands.rs index 8e70099..c16ad19 100644 --- a/bot/src/commands.rs +++ b/bot/src/commands.rs @@ -3,6 +3,5 @@ mod moderation; #[doc(inline)] pub use invite::invite; - #[doc(inline)] -pub use moderation::hackban; \ No newline at end of file +pub use moderation::hackban; diff --git a/bot/src/commands/moderation.rs b/bot/src/commands/moderation.rs index e829d18..9f9ce50 100644 --- a/bot/src/commands/moderation.rs +++ b/bot/src/commands/moderation.rs @@ -1,4 +1,4 @@ -use poise::serenity_prelude::{UserId, Color}; +use poise::serenity_prelude::{Color, UserId}; use crate::{Context, Result}; @@ -9,11 +9,21 @@ use crate::{Context, Result}; required_permissions = "BAN_MEMBERS", required_bot_permissions = "BAN_MEMBERS" )] -pub async fn hackban(ctx: Context<'_>, #[description = "The member you want to ban"] user: UserId, reason: Option) -> Result<()> { +pub async fn hackban( + ctx: Context<'_>, + #[description = "The member you want to ban"] user: UserId, + reason: Option, +) -> Result<()> { if let Some(ref reason) = reason { - ctx.guild().unwrap().ban_with_reason(&ctx.discord().http, user, 0, reason).await?; + ctx.guild() + .unwrap() + .ban_with_reason(&ctx.discord().http, user, 0, reason) + .await?; } else { - ctx.guild().unwrap().ban(&ctx.discord().http, user, 0).await?; + ctx.guild() + .unwrap() + .ban(&ctx.discord().http, user, 0) + .await?; } ctx.send(|b| { b.ephemeral(true); @@ -21,13 +31,17 @@ pub async fn hackban(ctx: Context<'_>, #[description = "The member you want to b e.color(Color::DARK_GREEN); e.title("Banned 🚫"); if let Some(reason) = reason { - e.description(format!("User `{}` got banned for reason `{}`", user, reason)); + e.description(format!( + "User `{}` got banned for reason `{}`", + user, reason + )); } else { e.description(format!("User `{}` got banned", user)); } e }); b - }).await?; + }) + .await?; Ok(()) -} \ No newline at end of file +} diff --git a/bot/src/main.rs b/bot/src/main.rs index 7683fd3..2c06113 100644 --- a/bot/src/main.rs +++ b/bot/src/main.rs @@ -85,7 +85,11 @@ async fn main() -> anyhow::Result<()> { ..Default::default() }, owners, - commands: vec![register::register(), commands::invite(), commands::hackban()], + commands: vec![ + register::register(), + commands::invite(), + commands::hackban(), + ], ..Default::default() }, data: data.clone(),