3 Config
hgw edited this page 2023-12-03 20:54:07 -08:00

Config

The example config has enough pre-configuration for you to be able to get the gist of what is going on, but if you need extra help, here is a list of all configurable options. This list may not always be up to date but the example configuration will be.

Settings are referred to by Mercury in a manner such as config.irc.server or config.errorhandling.error_channel. Each of the headers below before groups of options are the same but lowercase and with spaces removed in the code itself.

All options must be configured at this stage, so if you are unsure what values to input or change, leave them as default (you must change irc.server & irc.channels at a minimum).

IRC

Variable Description Options/Example
server The IRC server to connect to URL or IP
port The port which you want to connect to the server on Port Number
ssl Toggle SSL for the connection to the server true/false
channels Array list of channels the bot will join ["#example1", "#example2"]
nickname Nickname mercury
username Username mercury
realname Real Name git.supernets.org/hgw/mercury
autorejoin Auto Rejoin if bot is disconnected (this does not include crashes, Docker will handle auto-restarts in that case) true/false
prefix Client command prefix Anything I suppose, default is m!
settings_auth_enable Require authorisation to edit settings with m!opt operset true/false
settings_auth_hostmask Admin hostmask, this user can use m!opt operset to edit options in default.json if settings_auth_enabled is true ~user@supernets.org

Flood Protection

Variable Description Options/Example
flood_protection Queue messages to prevent excess flood kicks true/false
flood_protection_delay How long to queue messages for if floodprotection is enabled Number (milliseconds)
command_listen_timeout Timeout for the command listener, prevents the client from responding to spammed commands and getting banned, I recommend leaving this at the default value. Enabled irrespective of flood_protection unless set to 0 Number (milliseconds)

Error Handling

Variable Description Options/Example
error_logging Toggling sending console errors to IRC true/false
error_channel Channel to send console errors to #channel
error_channel_pass Password for the nominated error_channel, if it exists, leave this variable blank if not Channel Password
validity_override Bypass config validity checking during initialisation, this allows the bot to start with a bare minimum config file. This may have unintended side-effects, if you run in to issues with this enabled, you are on your own. Must be set to "TRUE" to be enabled TRUE/unset

Colours

See here for a guide on colour codes

Variable Description Options/Example
date Feed date colour 00-98
brackets Brackets colour 00-98
title Feed title colour 00-98
author Feed author colour 00-98
body Feed main text content colour 00-98
link Feed link colour 00-98
help_logo Colour of logo in m!help, if enabled 00-98
help_motd Colour of MOTD in m!help, if enabled 00-98
warning Colour of "WARNING" in warning messages 00-98
error Colour of "ERROR" in error messages 00-98

Feed

Variable Description Options/Example
useragent User agent to use for requests, required to prevent error 403's from some sites. I recommend leaving the default as-is, the Firefox user agent is known good for all uses Mozilla/5.0 (Macintosh; Intel Mac OS X 13.4; rv:109.0) Gecko/20100101 Firefox/114.0
body_max_chars How many main body characters to allow in any one post, to prevent single posts being split in to multiple messages Number (characters)
time_format Time format to use for post timestamps DD MMM YYYY HH:mm:ss ZZ
timezone IANA time zone to use for post timestamps GMT (for GMT) or Pacific/Auckland (for other)
default_amount Default amount of feed entries to post if the amount specified can not be achieved 5 is recommended
show_feed_title Show the title of an RSS feed before the output (not yet implemented) true/false

Twitter

Variable Description Options/Example
nitter_instances Array list of Nitter instances for the bot to cycle through (prevents load on any one instance). Domain name only, the rest is preformatted. ["nitter.id4.us", "nitter.pufe.org"]
default_amount Default amount of tweets to post if the amount specified can not be achieved 5 is recommended

Misc

Variable Description Options/Example
display_help_logo Display the Mercury logo in m!help true/false
logging Toggle logging actions to the terminal output, good for debugging true/false

MOTD

Variable Description Options/Example
enable Toggle the MOTD in m!help. Setting version sets the output to the value of version below true/false/version
list Array list of all MOTD outputs, randomised when m!help is run ["Output 1", "Output 2"]
version Version of Mercury, this setting will be replaced soon. Version