Tagscript

@tagscript/plugin-discordDocs


Function: resolveCommandOptions()

resolveCommandOptions(options): Record<string, ITransformer>

Resolves CommandInteractionOptionResolver options to transformers.

Parameters

options: Omit<CommandInteractionOptionResolver<CacheType>, "getFocused" | "getMessage">

Returns

Record<string, ITransformer>

Example

client.on('interactionCreate', async interaction => {
 if (!interaction.isCommand()) return;
 
 if (interaction.commandName === 'ping') {
  const result = await ts.run(str, resolveCommandOptions(interaction.options));
  await interaction.reply(result.body);
 }
});

Defined in

tagscript-plugin-discord/src/lib/Utils/CommandInteraction.ts:85

On this page