mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-04-16 07:18:54 +00:00
y2!kick now actually kicks instead of ban (#17)
Fix formatting y2!kick now actually kicks instead of ban
This commit is contained in:
parent
20a15efcc4
commit
99c7888dfb
1 changed files with 6 additions and 14 deletions
|
@ -58,7 +58,7 @@ fn clean(ctx: &mut Context, msg: &Message, mut args: Args) -> CommandResult {
|
||||||
#[command]
|
#[command]
|
||||||
#[required_permissions(ADMINISTRATOR)]
|
#[required_permissions(ADMINISTRATOR)]
|
||||||
#[description = "Ban an user with a certain reason."]
|
#[description = "Ban an user with a certain reason."]
|
||||||
#[usage = "ban user#1234 spam"]
|
#[usage = "@user#1234/spam"]
|
||||||
#[min_args(1)]
|
#[min_args(1)]
|
||||||
#[max_args(2)]
|
#[max_args(2)]
|
||||||
#[only_in("guilds")]
|
#[only_in("guilds")]
|
||||||
|
@ -83,26 +83,18 @@ fn ban(ctx: &mut Context, msg: &Message, mut args: Args) -> CommandResult {
|
||||||
|
|
||||||
#[command]
|
#[command]
|
||||||
#[required_permissions(ADMINISTRATOR)]
|
#[required_permissions(ADMINISTRATOR)]
|
||||||
#[description = "Kick an user with a certain reason."]
|
#[description = "Kick an user."]
|
||||||
#[usage = "kick user#1234 spam"]
|
#[usage = "@user#1234"]
|
||||||
#[min_args(1)]
|
#[num_args(1)]
|
||||||
#[max_args(2)]
|
|
||||||
#[only_in("guilds")]
|
#[only_in("guilds")]
|
||||||
fn kick(ctx: &mut Context, msg: &Message, mut args: Args) -> CommandResult {
|
fn kick(ctx: &mut Context, msg: &Message, mut args: Args) -> CommandResult {
|
||||||
let user = args.single::<UserId>()?.to_user(&ctx)?;
|
let user = args.single::<UserId>()?.to_user(&ctx)?;
|
||||||
let reason = args
|
|
||||||
.remains()
|
|
||||||
.map(|v| format!("`{}`", v))
|
|
||||||
.unwrap_or("no provided reason".to_owned());
|
|
||||||
|
|
||||||
msg.reply(
|
msg.reply(&ctx, format!("🔫 Kicking user {}.", user.tag()))?;
|
||||||
&ctx,
|
|
||||||
format!("🔫 Kicking user {} for {}.", user.tag(), reason),
|
|
||||||
)?;
|
|
||||||
|
|
||||||
msg.guild_id
|
msg.guild_id
|
||||||
.ok_or("Can't get guild from message?")? // we had a contract
|
.ok_or("Can't get guild from message?")? // we had a contract
|
||||||
.ban(&ctx.http, user, &reason)?;
|
.kick(&ctx.http, user)?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue