10 |
} |
} |
11 |
|
|
12 |
async run(client: DiscordClient, interaction: Interaction) { |
async run(client: DiscordClient, interaction: Interaction) { |
|
console.log('inside'); |
|
|
|
|
13 |
if (interaction.isCommand()) { |
if (interaction.isCommand()) { |
14 |
await client.setMessage(interaction); |
await client.setMessage(interaction); |
15 |
|
|
16 |
const { commandName } = interaction; |
const { commandName } = interaction; |
17 |
|
|
18 |
const command = await client.commands.get(commandName); |
const command = await client.commands.get(commandName); |
|
const allowed = await client.auth.verify(interaction.member! as GuildMember, commandName); |
|
19 |
|
|
20 |
if (command && command.supportsInteractions) { |
if (command && command.supportsInteractions) { |
21 |
|
const allowed = await client.auth.verify(interaction.member! as GuildMember, command); |
22 |
|
|
23 |
if (!allowed) { |
if (!allowed) { |
24 |
await interaction.reply({ |
await interaction.reply({ |
25 |
embeds: [ |
embeds: [ |
33 |
return; |
return; |
34 |
} |
} |
35 |
|
|
36 |
await command.run(client, interaction, { |
const options = { |
37 |
cmdName: commandName, |
cmdName: commandName, |
38 |
options: interaction.options, |
options: interaction.options, |
39 |
isInteraction: true |
isInteraction: true |
40 |
} as InteractionOptions); |
} as InteractionOptions; |
41 |
|
|
42 |
|
if (!await client.cooldown.start(interaction, options)) |
43 |
|
return; |
44 |
|
|
45 |
|
await command.run(client, interaction, options); |
46 |
} |
} |
47 |
} |
} |
48 |
} |
} |