Config - GazLloyd/Gazlunebot GitHub Wiki
You can see the default config here.
- Requires: boolean
-
Default:
false
true
, Gazlunebot is not registered as an event listener, so should minorly reduce lag.
This is toggled by /gazlunebot enabled
and /gazlunebot disable
- Requires: postive integer
-
Default:
20
- Requires: string
-
Default:
'<&dElunebot&r> '
Note: the prefix is prepended directly to the response, without a space. If you want a space, you'll need to provide one (which may mean you need to single-quote the entire message, like the default).
- Requires: string list
- Default: empty
Planned: allow gazlunebot.ignored
permission and command /gazlunebot (un)ignore <player>
.
- Requires: boolean
-
Default:
false
true
, Gazlunebot treats >hi and >HI and >hI and >Hi as 4 different commands. If false
, Gazlunebot treats all four variations as the same command.
- Requires: YAML subpath of PlainString: FormattedString, see examples
- Default: See above link
The basic format is as follows:
responses:
hi: Hi!
The command is first, followed by a colon and a space, then the response. From the above, saying >hi in chat prompts the bot to respond with Hi!
There are several special codes that can be used that are replaced at runtime.
If player Gaz_Lloyd runs the command >hi foo bar baz qux cheese cake
, the following table describes what each code does. The codes are replaced in the order listed.
Code | Replacement | Example |
---|---|---|
$a
|
All The entire message after the command |
foo bar baz qux cheese cake |
$1
|
First The first word after the command |
foo |
$2
|
Second The second word after the command |
bar |
$3
|
Third The third word after the command |
baz |
$4
|
Fourth The fourth word after the command |
qux |
$5
|
Fifth The fifth word after the command |
cheese |
$p
|
Player The display name of the player issuing the command. This is the name that can be changed by things like Essentials' /nick command, and can include colour.
|
Gaz_Lloyd |
$$
|
$ An escaped $. Prevents replacement if you want to use $ in your message, especially if it is followed by a numerical amount. |
$ |
- Advanced
$p
can accept a default value using curly braces:
responses:
rip: RIP in peace $1{everyone}
>rip Gaz
will give response RIP in peace Gaz, and using >rip
will give response RIP in peace everyone.
You can also use another code as a default, most notably $p
, e.g.:
responses:
hi: Hi $1{$p}!
>hi Gaz
respond Hi Gaz!, and >hi
respond Hi Gaz_Lloyd!.
If no default is specified, an empty string will be used instead.
Notes: Be wary of symbols with meaning in YAML. While normally the responses do not need to be quoted, any response using a YAML symbol may need to be, notably a lot of punctuation. One example is any response using :
(a colon followed by a space) - a response with this will need to be quoted (however, a colon without a space is usually fine, for example in URLs). Other examples include using hashes at all, or starting with hyphens, square or curly braces, percentage signs. See the list at YAML.org. In addition, remember to escape apostrophes in any response you quote (using ''
).
Check your server console when loading/reloading for errors - SnakeYAML is generally good at pointing out where the error is.