20 |
|
|
21 |
return; |
return; |
22 |
} |
} |
23 |
|
|
24 |
if (interaction.isCommand()) { |
if (interaction.isCommand()) { |
25 |
await client.setMessage(interaction); |
await client.setMessage(interaction); |
26 |
|
|
54 |
return; |
return; |
55 |
|
|
56 |
await command.run(client, interaction, options); |
await command.run(client, interaction, options); |
57 |
|
(global as any).lastCommand = commandName; |
58 |
} |
} |
59 |
} |
} |
60 |
else if (interaction.isAutocomplete()) { |
else if (interaction.isAutocomplete()) { |
80 |
} as AutoCompleteOptions; |
} as AutoCompleteOptions; |
81 |
|
|
82 |
await command.autoComplete(client, interaction, options); |
await command.autoComplete(client, interaction, options); |
83 |
|
(global as any).lastCommand = commandName; |
84 |
|
} |
85 |
|
} |
86 |
|
else { |
87 |
|
if (!(global as any).commandName) |
88 |
|
return; |
89 |
|
|
90 |
|
await client.setMessage(interaction); |
91 |
|
|
92 |
|
const command = await client.commands.get((global as any).commandName); |
93 |
|
|
94 |
|
if (command && command.supportsInteractions) { |
95 |
|
const allowed = await client.auth.verify(interaction.member! as GuildMember, command); |
96 |
|
|
97 |
|
if (!allowed) { |
98 |
|
return; |
99 |
|
} |
100 |
|
|
101 |
|
await command.default(client, interaction); |
102 |
} |
} |
103 |
} |
} |
104 |
} |
} |