TypeDoc API
Plugins
Plugin Discord
Getting Started

Module: tagscript-plugin-discord

Classes

Interfaces

Type Aliases

GuildChannel

Ƭ GuildChannel: Extract<Channel (opens in a new tab), { guild: Guild (opens in a new tab) }>


outputResolvable

Ƭ outputResolvable: boolean | number | string | null | undefined

Functions

mapOptions

mapOptions(options, transformers, prefix?): void

Parameters

NameTypeDefault value
optionsreadonly CommandInteractionOption (opens in a new tab)<CacheType (opens in a new tab)>[]undefined
transformersRecord<string, ITransformer>undefined
prefixstring''

Returns

void


resolveColor

resolveColor(color): string | number

Resolves a color to a number. This function doesn't throw for invalid colors but returns the input

Parameters

NameTypeDescription
colorstringThe color to resolve

Returns

string | number


resolveCommandOptions

resolveCommandOptions(options): Record<string, ITransformer>

Resolves CommandInteractionOptionResolver options to transformers.

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);
 }
});

Parameters

NameType
optionsOmit<CommandInteractionOptionResolver (opens in a new tab)<CacheType (opens in a new tab)>, "getFocused" | "getMessage">

Returns

Record<string, ITransformer>