From 960957e099325cc29d2de50298ec6a9f4b407ef7 Mon Sep 17 00:00:00 2001 From: Hexugory Date: Sat, 1 Apr 2023 02:47:30 -0500 Subject: [PATCH] no self challenge --- src/slash/challenge.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/slash/challenge.ts b/src/slash/challenge.ts index e051a2c..0077a0b 100644 --- a/src/slash/challenge.ts +++ b/src/slash/challenge.ts @@ -25,6 +25,11 @@ export class ChallengeCommand implements SlashCommand { async execute(int: CommandInteraction) { const args = createArgumentsObject(int.options.data); const client = int.client as CBClient; + + if (int.user.id === args.opponent.id) return int.reply({ + content: "You can't challenge yourself!", + ephemeral: true + }); const player1 = await CBClient.findOrCreatePlayer(int.user.id); const player2 = await CBClient.findOrCreatePlayer(args.opponent.id);