Skip to content
Erdragh edited this page Feb 8, 2025 · 5 revisions

Configuration

AstralBot uses multiple locations for different configuration purposes:

Config file

The most basic options for AstralBot are stored in the config file in the usual location (the config folder). It has the following options:


token

Type: String
Default: ""

Discord token for the bot. Can also be supplied via DISCORD_TOKEN environment variable.


webhook.url

Type: String
Default: ""

URL to the webhook where the messages will be sent from. Can be left empty, in which case the Bot will choose the first one available and create one if none exist.


webhook.enabled

Type: boolean
Default: true

Whether to use the configured webhook for sending messages from MC to Discord.


webhook.useLinked

Type: boolean
Default: false

Whether to imitate user's linked Discord accounts when sending messages from MC to Discord. This means that the Discord user's avatar will be used instead of their Minecraft Head.


webhook.mcAvatarUrl

Type: String
Default: "https://mc-heads.net/head/{{uuid}}"

API that returns images based on Minecraft users. {{uuid}} and {{name}} can be used. By default, this uses the MCHeads API.


requireLinkForWhitelist

Type: boolean
Default: false

AstralBot can be used for whitelisting in two different configurations. Either as an option for being whitelisted or as a requirement for being whitelisted. By default, it's configured as an option.

See:


discordLink

Type: String
Default: ""

The discord link where the user is supposed to run the /link command to whitelist themselves.

See:


discordChannel

Type: long
Default: -1

Numeric ID of the Discord text channel where chat messages are synchronized. For convenience, this is set when executing the /chatsync command.

See:


discordGuild

Type: long
Default: -1

Numeric ID of the Discord guild (server) where the chat messages are synchronized. For convenience, this is set when executing the /chatsync command.

See:


discordRole

Type: long
Default: -1

Numeric ID of the Discord role that is given to linked accounts. For convenience, this is configurable with the /linkrole command.

See:


clickableMessages

Type: boolean
Default: true

Discord messages that are synchronized into the Minecraft chat can be formatted with a click event that links to the corresponding message on Discord. This is enabled by default.


handleEmbeds

Type: boolean
Default: true

Discord messages can have so-called Embeds, for example sent images, website previews, etc.

AstralBot can format these by including them after the message content.

See:


clickableEmbeds

Type: boolean
Default: true

If the handling of Embeds is enabled, AstralBot can format them into clickable links. This is enabled by default, but not every Embed is turned into a clickable link as some URLs are blocked.

See:


urlBlocklist

Type: List<String>
Default: List of certain NSFW URLs

AstralBot can make links into clickable parts of a Minecraft chat message. The URL blocklist exists to prevent certain URLs from being handled.

See:


enabledCommands

Type: List<String>
Default: List containing the name of all commands the bot supports

As a server owner you may want to disable certain commands. To do so, remove its name from this list and run /reload.

See:


Whitelist message template

In the astralbot folder inside the root directory of the server installation is a file called whitelist.txt that contains the template for the message shown to users when they're not whitelisted yet.

There are three placeholders that will be replaced with the respective values:

  • {{USER}}: the Minecraft username that tried to join and will get the message
  • {{DISCORD}}: the link to the Discord server as configured in discordLink
  • {{CODE}}: the link code the user needs to use with the /link command on Discord

Other Text

The rest of the text used in AstralBot can be configured in astralbot-text.toml. The comments in that file will explain all the possible options.