zumito-framework 1.1.49 → 1.1.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -49,11 +49,19 @@ export class InteractionCreate extends FrameworkEvent {
|
|
|
49
49
|
}
|
|
50
50
|
else if (interaction.isSelectMenu()) {
|
|
51
51
|
let path = interaction.customId.split('.');
|
|
52
|
-
const
|
|
53
|
-
if (!
|
|
52
|
+
const commandInstance = framework.commands.get(path[0]);
|
|
53
|
+
if (!commandInstance)
|
|
54
54
|
throw new Error(`Command ${path[0]} not found or select menu id bad formatted`);
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
const trans = (key, params) => {
|
|
56
|
+
if (key.startsWith('$')) {
|
|
57
|
+
return framework.translations.get(key.replace('$', ''), guildSettings.lang, params);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
return framework.translations.get('command.' + commandInstance.name + '.' + key, guildSettings.lang, params);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
if (commandInstance.selectMenu) {
|
|
64
|
+
commandInstance.selectMenu({ path, interaction, client, framework, guildSettings, trans });
|
|
57
65
|
}
|
|
58
66
|
}
|
|
59
67
|
}
|
package/dist/types/Command.d.ts
CHANGED
|
@@ -20,5 +20,5 @@ export declare abstract class Command {
|
|
|
20
20
|
abstract execute({ message, interaction, args, client, framework }: CommandParameters): void;
|
|
21
21
|
executePrefixCommand({ message, interaction, args, client, framework, trans }: CommandParameters): void;
|
|
22
22
|
executeSlashCommand({ message, interaction, args, client, framework, trans }: CommandParameters): void;
|
|
23
|
-
abstract selectMenu({ path, interaction, client, framework }: SelectMenuParameters): void;
|
|
23
|
+
abstract selectMenu({ path, interaction, client, framework, trans }: SelectMenuParameters): void;
|
|
24
24
|
}
|