Skip to content

Commit

Permalink
feat: sub_command, sub_command_group command options
Browse files Browse the repository at this point in the history
  • Loading branch information
Faf4a committed Feb 25, 2024
1 parent 07aa710 commit ba7119c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/handler/NonIntents/interaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,7 @@ module.exports = async (interaction, client) => {
undefined,
);
}
} else
{
} else {

cmds = client.cmd.interaction.slash
.filter(
Expand All @@ -146,7 +145,12 @@ module.exports = async (interaction, client) => {
member: interaction.member,
isAutocomplete: interaction.isAutocomplete(),
};

for (const cmd of cmds) {

if (!!cmd.sub_command && interaction.options._subcommand !== cmd.sub_command) continue;
if (!!cmd.sub_command_group && interaction.options._group !== cmd.sub_command_group) continue;

if (cmd.name?.includes("$")) {
cmd.name = (
await Interpreter(
Expand All @@ -161,6 +165,7 @@ module.exports = async (interaction, client) => {
)
)?.code;
}

await Interpreter(
client,
data,
Expand Down

0 comments on commit ba7119c

Please sign in to comment.