Parsers
Discord specific tags for embeds, cooldowns, permissions and timestamps.
Every parser here except date renders an empty string and records what the template asked for on response.actions. Nothing is sent, deleted or restricted until your bot reads that object and acts.
const response = await ts.run(template, seedVariables);
// response.body is the text. response.actions is the request list.Available parsers
| Page | Tags | Records |
|---|---|---|
| Embed | embed | actions.embed |
| Cooldown | cooldown, cd | actions.cooldown |
| Require and deny | require, deny and their aliases | actions.require, actions.deny |
| Delete and silent | delete, del, silent | actions.deleteMessage, actions.silentResponse |
| Files | files | actions.files |
| Date | date, unix, currenttime | Nothing, renders inline |
The core built-in parsers work alongside these, so a Discord tag can still use if, random and the rest.
Typing
The plugin declaration-merges IActions, so importing it types the fields above on response.actions without any setup on your side.
import '@tagscript/plugin-discord';
response.actions.embed; // APIEmbed | undefined
response.actions.cooldown; // { cooldown: number; message: string | null } | undefinedLast updated on