Custom Commands - MiraWaNeko/DiscordIntegration GitHub Wiki
(Since 1.1.0)
The mod allows the server admin to add custom commands to Discord that executes a command on the server.
Any response to this command is then returned into the chat.
How to add a custom command?
To add a custom command, simply add it to the config file.
"custom": [
{
"name": "kick",
"cmd": "/kick %args%",
"roles": [
"Minecraft Moderator",
"Minecraft Admin"
]
},
{
"name": "ban",
"cmd": "/ban %args%",
"roles": [
"Minecraft Admin"
]
}
]
name
is the name of the command on Discord, in the example it would be !kick
.
cmd
is the command that will be executed on the Minecraft server.
roles
is an array of Discord role names that is able to run this command.
You can continue adding more custom commands to the array.
Arguments
As seen in the example, you can have arguments in the Minecraft command.
%args%
is everything after the command.
You can also use a number surrounded by %
, this will be replaced with the argument at that place.
!test This is an example
This... | ...would become... |
---|---|
%args% |
This is an example |
%1% |
This |
%2% |
is |
%3% |
an |
%4% |
example |