Parser
Table of Contents
- ExtraOptions/Options Parser Functions
- Embed Parser
- Message Components
- Components Parser
- Parsers Examples
ExtraOptions/Options Parser Functions
Syntax | Description | Example |
---|---|---|
{execute:awaitedCommand} | Executes an awaited command. | {execute:myCommand} |
{reply:messageId:reply?} | Replies to a specific message ID. | {reply:1234567890:Thanks!} |
{interaction} | Declares reply as an interaction. | {interaction} |
{ephemeral} | Marks the interaction as ephemeral (visible only to user). | {ephemeral} |
{reactions:...reactions} | Adds reactions to the message. | {reactions:π:π} |
{attachment:attachmentName:attachment} | Sends a file/image attachment. | {attachment:image.png:https://example.com/image.png} |
{file:fileName:content} | Sends a file with custom text content. | {file:hello.txt:Hello World} |
{deleteCommand} | Deletes the triggering command message. | {deleteCommand} |
{deleteIn:time} | Deletes the message after a given time. | {deleteIn:5s} |
{suppress} | Suppresses the output message. | {suppress} |
These parser can only be used within specific functions, for example:
$sendMessage
, $channelSendMessage
or similar. This includes functions like $onlyIf
.
Embed Parser
Embed Parser are handy to use once you know how, this section will be covering the basics about embed parsers.
Embed Parser Functions
Syntax | Description | Example |
---|---|---|
{title:text} | Sets the embedβs title. | {title:My Embed Title} |
{url:URL} | Makes the title a clickable link. | {url:https://example.com} |
{description:text} | Adds description text. | {description:This is a description} |
{color:color} | Sets the color bar on the side. | {color:#00ffcc} |
{footer:text:icon?} | Adds a footer with optional icon. | {footer:Made with aoi.js:https://example.com/icon.png} |
{image:URL} | Adds a large image below the embed. | {image:https://example.com/image.png} |
{thumbnail:URL} | Adds a small image at the top right. | {thumbnail:https://example.com/thumb.png} |
{author:name:icon?} | Adds an author line with optional icon. | {author:Bot Name:https://example.com/avatar.png} |
{authorURL:URL} | Makes the author name clickable. | {authorURL:https://example.com} |
{field:title:value:inline?} | Adds a field (can be inline or not). | {field:Name:Value:true} |
{timestamp:ms?} | Adds a timestamp to the embed. | {timestamp} or {timestamp:1628353826} |
Message Components
Message Components Functions
Syntax | Description | Example |
---|---|---|
{color:color} | Adds the color for the container. | {color:#00ff00} |
{spoiler:true/false} | Marks the container or media as a spoiler. | {spoiler:true} |
{text:content} | Adds a text display component inside a section or container. | {text:Hello World} |
{thumbnail:URL:spoiler?:description?} | Adds a thumbnail with optional spoiler and description. | {thumbnail:https://img.png:true:My Img} |
{button:label:style:custom_id:disabled?:emoji?} | Adds a button with label and style. | {button:ClickMe:primary:btn_1:false:π} |
{actionRow:{...}} | Defines an action row to group buttons or select menus. | {actionRow:{button:Click:primary:btn_2}} |
{gallery:{media:URL:spoiler?:description?}} | Adds a media gallery containing one or more media items. | {gallery:{media:https://img1.png}} |
{media:URL:spoiler?:description?} | Defines a single media item inside a gallery. | {media:https://img2.png:false:Sample} |
{separator:divider?:type?} | Adds a separator line with optional boolean divider (true/false) and numeric type. | {separator:true:1} |
{file:filename:spoiler?} | Adds a file attachment with optional spoiler flag. | {file:readme.txt:true} |
Components Parser
Button Parser
Usage:
{button:label:style:customID:disabled? (true / false):emoji?}
Button Types
Name | Value | Color | |
---|---|---|---|
Primary | 1 | Blurple. | {button:Button:primary:customID:false} |
Secondary | 2 | Grey. | {button:Button:secondary:customID:false} |
Success | 3 | Green. | {button:Button:success:customID:false} |
Danger | 4 | Red. | {button:Button:danger:customID:false} |
Link | 5 | Grey, navigates to a URL. | {button:Button:link:https\\:aoi.js.org/invite:false} |
Emoji | - | Primary button with emoji. | {button:Button:primary:customID:false:emojiName or emojiID or emoji String} |
Premium | 6 | Premium button that allows purchases. (only usable if you have monitarization enabled & converts automatically to userβs currency!) | {button:Button:premium:skuID:false} |
Select Menu Parser
Select Menu Parser Usage:
Syntax | Description | Example |
---|---|---|
{selectMenu:customID:placeholder:minValue:maxValue:default:true/false:...options} | Declares a select menu with customID, placeholder, min/max values, default, and options. | {selectMenu:menuID:Choose option:1:3:false:{stringInput:Option1:1:Desc1:false:π}} |
{stringInput:optionName:customID:optionDescription:default? (true/false):emoji?} | Adds a string option with name, ID, description, default, and optional emoji. | {stringInput:Option1:1:OptionDescription:false:π} |
For every option you want to add to the select menu, you can use one of the following inputs:
Input Name | Description |
---|---|
{roleInput} | Adds a role selection input to the select menu. |
{channelInput} | Adds a channel selection input to the select menu. |
{mentionableInput} | Adds a mentionable (user or role) selection input. |
{userInput} | Adds a user selection input to the select menu. |
Interaction Modal Parser
Interaction Modal Parser Usage:
Syntax | Description | Example Usage |
---|---|---|
{textInput:label:style:customID:required? (true / false):placeholder?:minLength?:maxLength?:defaultValue?} | Input field inside a modal interaction with many options. | {textInput:Name:1:customID:true:Enter your name:1:100} |
Parsers Examples
Below are simple examples of each parser and how to use them.
Embed Parser
Embed with title, footer, image and field.
{newEmbed: {title:Another Awesome Example!} {image:https://cdn.discordapp.com/banners/773352845738115102/01e9a05d24039fe562bcc8ab95e721f8.webp?size=4096} {field:This is a field title!:And a field description which is not inline!:false} {footer:Example #2}}
Message Components Parser
Component with text, button, and a gallery with media.
{newContainer: {color:0089ff}
{newSection: {text:This is a text!} {button:Click Me:primary:clickbutton:false} }
{gallery: {media:https://cdn.discordapp.com/banners/773352845738115102/01e9a05d24039fe562bcc8ab95e721f8.webp?size=4096:false:Sample image} }}
Components Parser
Button Parser
Two buttons each one in a different row.
{actionRow:{button:Button:secondary:button1}}{actionRow:{button:Button:primary:button2}}
Three buttons, one with emoji.
{actionRow:{button:Button:primary:button1:false}{button:Button:primary:button2:false}{button:Button:danger:button3:false:π}}
Select Menu Parser
Single-Select Menu with two options
{actionRow:{selectMenu:customID:Placeholder:1:1:false:{stringInput:Option1:1:OptionDescription1:false:π}{stringInput:Option2:2:OptionDescription2:false}}}
Multi-Select Menu with three options and a maximum of 2 selectable options
{actionRow:{selectMenu:customID:Placeholder:1:2:false:{stringInput:Option1:1:OptionDescription1:false:π}{stringInput:Option2:2:OptionDescription2:false}{stringInput:Option3:3:OptionDescription3:false}}}
Other Select Menus
User Select Menu
{actionRow:{selectMenu:customID:Placeholder:1:1:false:{userInput}}}
Interaction Modal Parser
Modal with two fields one being normal sized and the other being bigger.
{actionRow:{textInput:ExampleTitle1:1:customID1:true}}{actionRow:{textInput:ExampleTitle2:2:customID2:false}}