no self challenge
This commit is contained in:
parent
a2df5f3f3d
commit
960957e099
@ -25,6 +25,11 @@ export class ChallengeCommand implements SlashCommand {
|
|||||||
async execute(int: CommandInteraction) {
|
async execute(int: CommandInteraction) {
|
||||||
const args = createArgumentsObject<ChallengeArguments>(int.options.data);
|
const args = createArgumentsObject<ChallengeArguments>(int.options.data);
|
||||||
const client = int.client as CBClient;
|
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 player1 = await CBClient.findOrCreatePlayer(int.user.id);
|
||||||
const player2 = await CBClient.findOrCreatePlayer(args.opponent.id);
|
const player2 = await CBClient.findOrCreatePlayer(args.opponent.id);
|
||||||
|
Loading…
Reference in New Issue
Block a user