-
Notifications
You must be signed in to change notification settings - Fork 2
Configuration
This page lists everything you can add to your config.json
. To find the location of your config.json
, please see the section on Additional Configuration.
-
Do not edit the `config.json` that is supplied with the repo, as this is the reference copy that the bot uses to create your own personalised
config.json
elsewhere on your system.
This is the default configuration that is installed with every new bot. It also reflects the minimum configuration required to get the bot working.
"admins": []
# no admins are configured when bot is first run
This key defines bot administrators and is an empty list for new bots. During Initial Configuration, the starter plugin will add the first administrator "chat id" to this list automatically.
It can also be configured manually, by editing the file and adding chat ids to the list. A bot can have unlimited administrators. Example:
"admins": [ "111111111111111111111", "111111111111111111112", "111111111111111111113" ]
# Note: Chat ids are always numerical, and identify the Hangouts user
After the initial configuration is completed, it is also possible for admins to modify this key using the /bot config
command in the default plugin
"autoreplies_enabled": true, "autoreplies": [ [ [ "hi bot", "hello bot" ], "Hello world!" ] ]
# auto-replies enabled when bot is first run
The default configuration for the autoreply plugin allows the bot to reply any message with containing the phrase "hi bot" and "hello bot" with "Hello world!"
These keys are supported as per-conversation settings
"commands_enabled": true
# user commands are enabled on bot first run
This key determines whether the bot will respond to user commands when it is started.
When set to false
, the bot will ignore all commands except those originating from users configured as [admins](#admins).
This key is supported as a per-conversation setting
"conversations": { "CONV_ID": { "autoreplies_enabled": false, "commands_enabled": false } }
# default configuration does nothing as CONV_ID won't match a conversation
The conversations<code> key is a special key that can hold '''per-conversation settings'''.
These settings only apply to a specific conversation ID (<code>CONV_ID
) and always override the global setting if it is set in both places.
Per-conversation settings are generally used to enable/disable features, and to supply custom configuration directives, for specific conversations.
To get the conversation ID of a conversation, use the command: /bot whereami
"plugins": null
# all available plugins loaded when bot is first run
This key defines which plugins to load at bot startup as well as the order of plugin loading.
Leaving this unset or null
will load all available plugins (and sub-plugins) with arbitrary startup order (based on filesystem).
Developer Note: Plugin names always correspond to their actual file (or folder names) on the filesystem.
Therefore, example_plugin
will load plugins/example_plugins.py
or plugins/example_plugins/__init__.py
Some complex plugins may be stored inside a sub-folder inside the plugins directory.
The base plugin usually can be loaded by specifying the folder name in the plugins
key:
"plugins": ["example"]
# loads the base plugin inside plugins/example/
Occasionally, a plugin may contain additional related sub-plugins inside the sub-folder
and the file system structure may resemble the following:
+ plugins + example * __init__.py * example_subplugin1.py * example_subplugin2.py
# Note: Sub-plugins are always prefixed with the folder/plugin name
To activate the main plugin and its corresponding sub-plugins manually,
use the following configuration:
"plugins": [ "example", "example.example_subplugin1", "example.example_subplugin2" ]
# RECOMMENDED: load the main plugin before the sub-plugins
In the above configuration, the sub-folder name is both part of the sub-plugin package path (before the .
) and the prefix of the sub-plugin filename itself (e.g. example_subplugin1
).
An alternate form that does not require the parent module/folder name is also available.
Please note that using this format is NOT RECOMMENDED and is only intended for backward-compatibility with older versions of config.json
.
Additionally, sub-plugins with ambiguous names will not load and will raise a warning during bot initialisation.
"plugins": [ "example", "example_subplugin1", "example_subplugin2" ]
# NOT RECOMMENDED - PLEASE UPDATE TO NEWER FORMAT
Note: The bot will automatically load all available plugins and sub-plugins if the plugins
key is unset or null
.
"watch_new_adds": false
# monitoradds plugin will not monitor user adds/joins
Determines the state of user add monitoring by the Monitor Adds plugin
This key is supported as a per-conversation setting
All other keys that can be added to the bot configuration and that are not set by default.
Sets the path for [Chatlogger-Plugin|chatlogger] to store conversation logs
[ver] Make listed commands admin-only
[ver] Access Control with Tags - Configure listed commands as admin-only
[ver] Access Control with Tags - Configures extra tags to add to commands
This key is supported as a per-conversation setting
[ver] Whitelist listed commands as available to users, other unlisted commands become admin-only
[ver] [Access](https://github.com/hangoutsbot/hangoutsbot/wiki/Access-Control-with-Tags) - [Configure](https://github.com/hangoutsbot/hangoutsbot/wiki/Customising-Access-Control#commands_user)
This key is supported as a per-conversation setting
[ver] [Access](https://github.com/hangoutsbot/hangoutsbot/wiki/Access-Control-with-Tags) - [Configures](https://github.com/hangoutsbot/hangoutsbot/wiki/Customising-Access-Control#commandstagsdeny-prefix)
Optional key to set the language of the bot.
When not set, the default language is English (untranslated).
Depending on the status of the translation project, you can set this key to match any of the available language codes such as de
for German, sv
for Swedish, etc.
Note: This setting takes precedence over the environment variable HANGOUTSBOT_LOCALE
When set, overrides the default number of backup files (default: 3) that will be created and maintained by the bot on every memory.json
write
To disable backups entirely, use string "0"
e.g. "memory-failsafe_backups": "0"
When set, overrides the default save delay of memory.json
of 1 second
To disable the delay entirely, use string "0"
e.g. "memory-save_delay": "0"
Contains a list of user ids designated as moderators, used by the Monitor Adds plugin
This key is supported as a per-conversation setting
Note: Use of the mod
key is not recommended, we recommend tagging users as mods instead.
[ver] Access Control with Tags - Configures tag auto-registration settings
Plugin List | Developer Reference: [ Intro | Plugins | Sinks | In-built Functionality | [Configuration] (Configuration) ]