no self challenge

This commit is contained in:
Hexugory 2023-04-01 02:47:30 -05:00
parent a2df5f3f3d
commit 960957e099

View File

@ -25,6 +25,11 @@ export class ChallengeCommand implements SlashCommand {
async execute(int: CommandInteraction) {
const args = createArgumentsObject<ChallengeArguments>(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);