How to configure Message
All messages from ItsMyBot can be configured with the following options, offering you even more possibilities. The messages support placehalders in every property. You can use them to create dynamic messages that change based on the context.
Example
content: "Hello %user_mention% !"
embeds:
- title: "%mcstatus_example_players% Players"
description: "Server is %mcstatus_example_status% !"
color: "#ff0000"
components:
"1":
- type: "button"
label: "First Button"
style: "primary"
custom-id: "button1"
- type: "button"
label: "Second Button"
style: "link"
url: "https://example.com"
emoji: "๐"
Message Properties
All the properties you can use in the message configuration. Every property is optional.
content
The content of the message. Supports multi-line content with the pipe character |
, random content with a list, and hide a line if it starts with show=false
. This is useful when using placeholders.
content: |
Hello there !
You need to use the pipe character (|) to create a multi-line message.
show=%show_message% Hide the line if it's return 'false'.
# When using a list, the bot will randomly choose one of the items.
content:
- Hello there !
- Hi, I'm ItsMyBot !
- Hello %user_displayname% !
ephemeral
If true, the bot will send the message as an ephemeral message. This only works for messages from an interaction.
ephemeral: true
disable-mentions
If true, the bot will disable all mentions in the message.
disable-mentions: true
embeds
Embeds are a way to send rich messages with images, titles, and descriptions. You can use them to create beautiful messages with a lot of information. You can find all the properties you can use in the embeds configuration, every property is optional.
embeds:
- title: Hello there !
description: I'm a signle line embed.
color: "#FF0000"
timestamp: true
- title: This is a second embed
description: I'm a second embed.
Every value bellow is to be used in the embeds
property.
author
The author of the embed. Supports random content with a list.
author: Hello there !
# When using a list, the bot will randomly choose one of the items.
author:
- Hello there !
- Hi, I'm ItsMyBot !
- Hello %user_displayname% !
author-icon
The icon of the author. Only works if author is set. Supports random content with a list.
author-icon: https://example.com/icon.png
author-url
The url of the author. Only works if author is set. Supports random content with a list.
author-url: https://itsme.to/
url
The url of the embed. Only works if title is set. Supports random content with a list.
url: https://itsme.to/
title
The title of the embed. Supports random content with a list.
title: Hello there !
# When using a list, the bot will randomly choose one of the items.
title:
- Hello there !
- Hi, I'm ItsMyBot !
- Hello %user_displayname% !
description
The description of the embed. Supports random content with a list, multi-line content with the pipe character |
, and hide a line if it starts with show=false
. This is useful when using placeholders.
description: Hello there !
description: |
Hello there !
You need to use the pipe character (|) to create a multi-line embed.
show=%show_message% Hide the line if it's return 'false'.
# When using a list, the bot will randomly choose one of the items.
description:
- Hello there !
- Hi, I'm ItsMyBot !
- Hello %user_displayname% !
color
The color of the embed. Supports random content with a list. If not set, the bot will use the default color defined in configs/config.yml
.
color: "#FF0000"
image
The image of the embed. Supports random content with a list.
image: https://example.com/image.png
thumbnail
The thumbnail of the embed. Supports random content with a list.
thumbnail: https://example.com/thumbnail.png
footer
The footer of the embed. Supports random content with a list.
footer: Hello there !
footer-icon
The icon of the footer. Only works if footer is set. Supports random content with a list.
footer-icon: https://example.com/icon.png
timestamp
If true, the bot will add a timestamp to the embed.
timestamp: true
conditions
The conditions of the embed. If the conditions are not met, the embed will be hidden.
conditions:
- id: aboveMembers
args:
amount: 10
fields
All the fields of the embed. You can use them to create a list of items or to add more information to the embed. It's support conditions, if the conditions is not met, the field will be hidden.
fields:
- name: Hello there !
value: I'm a field embed.
inline: true # Optional
conditions: # Optional
- id: aboveMembers
args:
amount: 10
components
Components are a way to add interactivity to your messages. You can use them to create buttons, select menus, and more. If the customId start with script_
the bot can trigger a script when the component is used.
Components is a list of 5 rows, each row can contain 1 to 5 components. The bot will automatically create the rows for you.
components:
"1": # Row 1
- type: "button"
label: "First Button"
style: "primary"
custom-id: "button1"
- type: "button"
label: "Second Button"
style: "link"
url: "https://example.com"
emoji: "๐"
"2": # Row 2
- type: "select-menu"
custom-id: "select1"
placeholder: "Select an option"
options:
- label: "Option 1"
value: "option1"
- label: "Option 2"
value: "option2"
button
Add a button to the message. You can use it to create a button that will trigger an action when clicked. Every value except type
is optional and support random content with a list. url
and custom-id
are mutually exclusive, you need to set one of them. If the customId start with script_
the bot can trigger a script when the button is used. This also suport conditions, if the conditions is not met, the button will be hidden.
type: "button"
label: "First Button"
style: "primary" # Optional, default to "primary". Can be "primary", "secondary", "success", "danger", "link"
custom-id: "button1"
url: "https://example.com" # Optional, only works if style is "link" or not defined
emoji: "๐" # Optional
conditions: # Optional
- id: aboveMembers
args:
amount: 10
select-menu
Add a select menu to the message. You can use it to create a select menu that will trigger an action when selected. Every value except type
& custom-id
is optional and support random content with a list. Option of the select menu support conditions, if the conditions is not met, the option will be hidden. min-values
and max-values
are optional and default to 0 and 1 respectively.
type: "select-menu"
custom-id: "select1"
placeholder: "Select an option" # Optional
min-values: 0 # Optional, default to 0
max-values: 1 # Optional, default to 1
options: # Required
- label: "Option 1"
value: "option1"
conditions: # Optional
- id: aboveMembers
args:
amount: 10