From 97cac42fbfd3a7eb6f1634d4d52fb4ace9b92674 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C8=9Bca=20Dumitru?= Date: Tue, 22 Dec 2020 00:57:13 +0200 Subject: [PATCH] Do not allow people to stab themselves See #10 --- src/commands/game/stab.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/commands/game/stab.rs b/src/commands/game/stab.rs index 0fedf16..7756ad9 100644 --- a/src/commands/game/stab.rs +++ b/src/commands/game/stab.rs @@ -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());