We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ee65b16 commit 325ba93Copy full SHA for 325ba93
1 file changed
src/util/commands.ts
@@ -1,4 +1,4 @@
1
-import type { Client } from 'discord.js';
+import type { ChatInputCommandInteraction, Client } from 'discord.js';
2
import type { Command } from '../commands/types.js';
3
4
export const createCommand = (command: Command): Command => {
@@ -25,3 +25,8 @@ export const registerCommands = async (
25
console.error('Error registering commands:', error);
26
}
27
};
28
+
29
+export const buildCommandString = (interaction: ChatInputCommandInteraction): string => {
30
+ const commandName = interaction.commandName;
31
+ return `/${commandName} ${interaction.options.data.map((option) => `${option.name}:${option.value}`).join(' ')}`;
32
+};
0 commit comments