Module: tagscript-plugin-discord
Classes
- BaseTransformer
- ChannelTransformer
- CooldownParser
- DateFormatParser
- DeleteParser
- DenyParser
- EmbedParser
- FilesParser
- GuildTransformer
- InteractionTransformer
- MemberTransformer
- RequiredParser
- RoleTransformer
- SilentParser
- UserTransformer
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
Name | Type | Default value |
---|---|---|
options | readonly CommandInteractionOption (opens in a new tab)<CacheType (opens in a new tab)>[] | undefined |
transformers | Record <string , ITransformer > | undefined |
prefix | string | '' |
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
Name | Type | Description |
---|---|---|
color | string | The 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
Name | Type |
---|---|
options | Omit <CommandInteractionOptionResolver (opens in a new tab)<CacheType (opens in a new tab)>, "getFocused" | "getMessage" > |
Returns
Record
<string
, ITransformer
>