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

Defined in

tagscript-plugin-discord/src/lib/interfaces/index.ts:17


outputResolvable

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

Defined in

tagscript-plugin-discord/src/lib/Transformer/Base.ts:5

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

Defined in

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


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

Defined in

tagscript-plugin-discord/src/lib/Utils/resolveColor.ts:9


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>

Defined in

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