-
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
file 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"
]
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
autoreply plugin enabled when bot is first run
This key is supported as a per-conversation setting
"autoreplies": [
[
[
"hi bot",
"hello bot"
],
"Hello world!"
]
]
Starter configuration for autoreply plugin
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!"
This key is supported as a per-conversation setting
"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.
This key is supported as a per-conversation setting
"silentmode": true
Silentmode is disabled by default
This key determines whether the bot will respond to unknown or blocked commands.
When set to true
, the bot will not respond to invalid commands.
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 any conversation
The conversations
key is a special key that can hold per-conversation settings.
These settings only apply to a specific conversation ID (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
"mentionall": true
Allow keyword @all
for mentioning everybody at once by default
For more information, please see Mentions plugin configuration section.
This key is supported as a per-conversation setting
"mentionallwhitelist": []
Default configuration has no users who can always mention @all
For more information, please see Mentions plugin configuration section.
This key is supported as a per-conversation setting
"mentionerrors": true
Default configuration turns on display of errors and warnings for mentions
It is recommended to turn this off (false
) when you are more confident of using this plugin.
For more information, please see Mentions plugin configuration section.
This key is supported as a per-conversation setting
"mentionquidproquo": true
Only users who already have a 1-to-1 with the bot can mention others by default
For more information, please see Mentions plugin configuration section.
"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"]
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
Sub-plugins are always prefixed with the "root" folder/plugin name as seen above.
To activate the main plugin and its corresponding sub-plugins manually, use the following configuration:
"plugins": [
"example",
"example.example_subplugin1",
"example.example_subplugin2"
]
It is recommended to 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"
]
Note: The bot will automatically load all available plugins and sub-plugins if the plugins
key is unset or null
.
"watch_new_adds": false
Monitor Adds 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.
Determines whether the bot will try and create a new 1-to-1 conversation with a user when trying to message them privately. Default (when unset) is true
This key is available for diagnostic purposes, and this feature should not be turned off unless specifically instructed by the developers.
Sets the path for chatlogger plugin to store conversation logs
[ver<2.7]
Make listed commands admin-only
[ver>=2.7]
Access Control with Tags - Configure listed commands as admin-only
[ver>=2.7]
Access Control with Tags - Configures extra tags to add to commands
This key is supported as a per-conversation setting
[ver<2.7]
Whitelist listed commands as available to users, other unlisted commands become admin-only
[ver>=2.7]
Access Control with Tags - Configure listed commands as available to users and all other unlisted commands as admin-only
This key is supported as a per-conversation setting
[ver>=2.7]
Access Control with Tags - Configures prefix for "deny" tag
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"
When set to false
, turns off mentions
For more information, please see Mentions plugin configuration section.
This key is supported as a per-conversation setting
When set, overrides the default minimum length for a mention keyword of 2 characters
For more information, please see Mentions plugin configuration section.
This key is supported as a per-conversation setting
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>=2.7]
Access Control with Tags - Configures tag auto-registration settings
Plugin List | Developer Reference: [ Intro | Plugins | Sinks | In-built Functionality | [Configuration] (Configuration) ]