Skip to content

Commands

Erdragh edited this page Feb 8, 2025 · 2 revisions

AstralBot commands

This is a (hopefully) conclusive list of all Slash commands available on AstralBot. If you - as a server admin - want to disable one of them, see the enabledCommands Config Option.

Bot management commands

/reload

This command reloads the Slash commands available on the Discord guild (server). Use this after changing the enabledCommands Config Option to unregister the disabled commands on the Discord. As you may want to reload the commands without any ever registered in the first hand, there's a plaintext command alternative !reload that the guild owner has to write into a text channel the Discord bot has access to.

See:


/chatsync

Options:

  • channel: Discord Text Channel (optional)

    The channel where the Minecraft messages will be sent to Discord and vice versa.

Changes the discordChannel Config Option to the given channel or the channel where the command was executed and the discordGuild Config Option to the guild where the command was executed.

See:


/linkrole

Options:

  • role: Discord Role (required)

    The role given to linked members.

This command changes the discordRole Config Option to the given role and assigns it to all members that were linked so far and will link themselves in the future.

See:

Utility commands

/faq

Options:

  • id: String (required, autocompleted)

    The ID of the FAQ you want to have displayed. Autocompleted based on the filenames of .md files in the astralbot/faq folder.

This command reads the contents of the requested FAQ from the disk to send to Discord. Adding new FAQ files does not require a server restart, as the contents of the astralbot/faq folder are watched and the bot reacts to changes at runtime.

Any .md file in the above-mentioned folder will be accessible as an FAQ and its name will be suggested as a value for the id option. Discord has some special handling of messages with only a link to an image in it, so if you want to send an image as a response to a /faq command, just put the URL of the image and nothing else in the .md file.

See:


/listfaq

Options:

  • slug: String (optional, autocompleted)

    Optional search key, narrows the results to only those that include the given input

This command lists all available FAQs. Since discord has a limitation of 25 entries max when autocompleting this can be useful to check which FAQs are available.

See:

Player related commands

/link

Options:

  • code: int (required)

    Link code the caller received on the "You're not whitelisted!" screen.

This command links the caller's Discord user with the Minecraft user that received the given code. If the whitelist is enabled, this will now allow the Minecraft user to join the server.

See:


/unlink

Options

  • user: Discord User (optional)

    The user that will be unlinked. If not provided, the command issuer will be used.

    When unlinking someone else you need to have the MODERATE_MEMBERS permission.

This unlinks the caller's Discord user from the previously linked Minecraft user. If the whitelist is enabled, this may now prevent the Minecraft user joining the server.

See:


/linkcheck

Options:

  • mc: String (optional, autocompleted)

    The Minecraft username for which you want to find out the linked Discord user. Autocompleted with the currently online players, but not limited to them. You can input any String that's not suggested, and the command will still work, provided it's a username that was linked before.

  • dc: Discord User (optional)

    The Discord user for whom you want to find out the linked Minecraft username.

This command looks up the link status of the given dc user or mc username in the Whitelist database. Both options are marked as optional, but you need to give either the one or the other, never both or none. If the user or username is found in the database the associated username or user will be sent back to the caller on Discord.

See:


/list

Lists the names of all currently online players.

Minecraft server management commands

/stop

Stops the Minecraft server the same way that a /stop command executed from within Minecraft does.


/uptime

Prints out the current uptime of the server, measured from the point in time when AstralBot itself started up.


/tps

Prints out the current average time per tick in MSPT and the TPS calculated from it.


/usage

Prints out system usage information. This means:

If the com.sun.management classes are available (Should be the case on any major Java distribution based on Hotspot):

  • Percentage of CPU usage that stems solely from the currently running java process
  • Percentage of the complete system CPU usage

Normally always available:

  • Memory usage of the Java Heap
  • Memory usage of Java outside the Heap
  • Total memory usage of the JVM out of the memory it is allowed to use (-Xmx)

Fun commands

/headpat

Options:

  • user: Discord User (required)

    The user whose avatar will be headpat.

This command allows you to headpat any Discord user. It will create a GIF and send it.