For a list of available commands, hit !readme on a running instance.
python
in these instructions with whatever command will run python 3.python -m pip install -r requirements.txt
.python corebot.py
.You should now have a running, non-configured version of LongSphinx running on your server. To see what's available without further configuration, hit him with a !readme
command in a channel called bot-commands (his default channel).
The config file is in YAML. YAML is a lot like JSON; it's designed to have less boilerplate, and adds some useful features to avoid data duplication. A full overview of YAML is outside the scope of this documentation; a useful cheat sheet can be found here.
The first thing you'll want to do is find your server ID; you can right click your server icon in the Discord app and select "Copy ID" from the bottom of the context menu.
Add the following to the end of config.yaml (including indentation):
'your-server-id':
strings:
<<: *defaultStrings
<<: *defaults
In YAML, "anchors" can be created with &
- for instance, &defaults
. You can then reference these anchors later with *
, such as the *defaults
above.
The <<:
construction is a special key that indicates that whatever follows should be merged into that level of the hierarchy. However, if a key already exists, it doesn't overwrite it; therefore it should always be at the end of the section, so as to allow your server-specific config to overwrite the defaults.
Note that the "defaultStrings" are imported separately from the rest of the defaults; if this were not the case, attempting to overwrite a single string would result in all of the defaults being lost.
The effect of all this is, because LongSphinx loads the "default" server if the server id is not found, nothing. The above block of YAML simply imports the defaults. HOWEVER, it gives you a place to add any of the other configuration you may want.
One last warning: pay attention to the difference between values:
defaultChannel: bot-commands
OR
defaultChannel:
bot-commands
lists:
channels:
- bot-commands
and maps (note maps don't have to have a value for each key):
element:
Solar:
Lunar:
Gaian:
In general, you probably just want to make sure your formatting matches that of the existing servers for any given field.
list
of channels to ban the bot from, or if channelListBehavior
is set to allow
, an exclusive list of channels to allow the bot inlist
of generators to have on this server. These map to filenames in the genConfig folder; in general, the default will include all of them that are considered "standalone".!rerole
(only works with defaultRoleset
). {0} tags the requester, {1} names their new role.defaultRoleset
is set)urls: roleImage: {rolesetname}:
will be embedded if available.map
of available rolesets. Anatomy of a roleset will be covered later.A roleset is a map
of map
s (of list
s). At its most basic, it should look like:
rolesets:
{rolesetname}:
type: {selector or toggle}
roles:
{rolename1}:
{rolename2}:
{rolename3}:
{rolesetname} is the name of the roleset; this is used as-is as the command for viewing the list of, requesting, and clearing roles in this roleset, so choose it appropriately. (However, it can be changed later without any loss of data.)
A role of type "selector" is exclusive; selecting a role from that list will remove any other roles in that list. If the roleset is not the defaultRoleset, the roles can be removed with !{rolesetname} none
. Conversely, if the roleset type is "toggle", a user can self-assign as many roles as they like from that list, and removing a given role is done by calling !{rolesetname} {rolename}
again.
Each {rolename} is the literal name of the role. Behavior is undefined if you have multiple roles on your server with that name. Do not leave off the colon on each line.
Optionally, each role may include a list of secondaryRoles
which will also be applied when that role is assigned or requested. These will not be cleared on role update or role clear unless they're included in the removeOnUpdate
list, which should be a sibling to the individual roles.
Note that requesting a role within a roleset will clear any other roles in that roleset (and any in that roleset's removeOnUpdate
list).
Also, you can optionally include a "description" under each role; the feature to utilize these has not yet been implemented.