Config - GazLloyd/Gazlunebot GitHub Wiki

Table of Contents

Default

You can see the default config here.

Explanation

enabled

Requires: boolean
Default: false
This is the overall enable/disable toggle. When true, Gazlunebot is not registered as an event listener, so should minorly reduce lag.

This is toggled by /gazlunebot enabled and /gazlunebot disable

delay

Requires: postive integer
Default: 20
This is the delay between the triggering chat being received by Bukkit and the response being sent, in server ticks between (with 20 server ticks per second). If this is too low, this can cause the response to be displayed in chat before the triggering message is.

prefix

Requires: string
Default: '<&dElunebot&r> '
The prefix is prepended to each response. This can be an empty string, and the response is just sent as a message (as if you used /help or such). This is intended to emulate the behaviour of the IRC bot, but you can set this to whatever. All normal Minecraft formatting codes can be used with &.

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).

ignored

Requires: string list
Default: empty
All players listed here are ignored by the bot and all commands said by them will go un-responded-to.

Planned: allow gazlunebot.ignored permission and command /gazlunebot (un)ignore <player>.

casesensitive

Requires: boolean
Default: false
If 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.

responses

Requires: YAML subpath of PlainString: FormattedString, see examples
Default: See above link
This is where all the responses are defined.

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
All of the listed codes except $p can accept a default value using curly braces:
responses:
  rip: RIP in peace $1{everyone}
In this example, using >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}!
Making >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.

⚠️ **GitHub.com Fallback** ⚠️