Skip to content

Commit

Permalink
Do not allow people to stab themselves
Browse files Browse the repository at this point in the history
See #10
  • Loading branch information
RealKC committed Dec 21, 2020
1 parent c7559bf commit 97cac42
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/commands/game/stab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ pub async fn stab(ctx: &Context, msg: &Message, mut args: Args) -> CommandResult
return Ok(());
}

if target == msg.author.id {
msg.reply(ctx, "You cannot stab yourself!").await?;
return Ok(());
}

let channel = msg.channel(ctx).await;
if channel.is_none() {
return Err("Got an invalid channel somehow".into());
Expand Down

0 comments on commit 97cac42

Please sign in to comment.