21 |
return; |
return; |
22 |
} |
} |
23 |
|
|
24 |
if (interaction.isCommand()) { |
if (interaction.isCommand() || interaction.isContextMenu()) { |
25 |
await client.setMessage(interaction); |
await client.setMessage(interaction); |
26 |
|
|
27 |
const { commandName } = interaction; |
const { commandName } = interaction; |
28 |
|
|
29 |
const command = await client.commands.get(commandName); |
const command = await client.commands.get(commandName); |
30 |
|
|
31 |
if (command && command.supportsInteractions) { |
if (command && ((interaction.isCommand() && command.supportsInteractions) || (interaction.isContextMenu() && command.supportsContextMenu))) { |
32 |
const allowed = await client.auth.verify(interaction.member! as GuildMember, command); |
const allowed = await client.auth.verify(interaction.member! as GuildMember, command); |
33 |
|
|
34 |
if (!allowed) { |
if (!allowed) { |
53 |
if (!await client.cooldown.start(interaction, options)) |
if (!await client.cooldown.start(interaction, options)) |
54 |
return; |
return; |
55 |
|
|
56 |
await command.run(client, interaction, options); |
await command.execute(client, interaction, options); |
57 |
(global as any).lastCommand = commandName; |
(global as any).lastCommand = commandName; |
58 |
} |
} |
59 |
} |
} |
71 |
return; |
return; |
72 |
} |
} |
73 |
|
|
74 |
|
if (!(await command.perms(client, interaction))) { |
75 |
|
return; |
76 |
|
} |
77 |
|
|
78 |
const options = { |
const options = { |
79 |
cmdName: commandName, |
cmdName: commandName, |
80 |
options: interaction.options, |
options: interaction.options, |
101 |
if (!allowed) { |
if (!allowed) { |
102 |
return; |
return; |
103 |
} |
} |
104 |
|
|
105 |
|
if (!(await command.perms(client, interaction))) { |
106 |
|
return; |
107 |
|
} |
108 |
|
|
109 |
await command.default(client, interaction); |
await command.default(client, interaction); |
110 |
} |
} |