-
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.
- Default
configuration required to get the bot working.
- `admins`
"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]
(https://github.com/hangoutsbot/hangoutsbot/blob/master/INSTALL.md#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**] (https://github.com/hangoutsbot/hangoutsbot/wiki/Default-Commands-Plugin) plugin.
- `autoreplies_enabled`, `autoreplies`
"autoreplies_enabled": true,
"autoreplies": [
[
[
"hi bot",
"hello bot"
],
"Hello world!"
]
]
# auto-replies enabled when bot is first run
The default configuration for the [**autoreply]
(https://github.com/hangoutsbot/hangoutsbot/wiki/Autoreply-Plugin) will allow 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]
(https://github.com/hangoutsbot/hangoutsbot/wiki/Configuration#conversations).
- `commands_enabled`
"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]
(https://github.com/hangoutsbot/hangoutsbot/wiki/Configuration#conversations).
- `conversations`
"conversations": {
"CONV_ID": {
"autoreplies_enabled": false,
"commands_enabled": false
}
}
# default configuration does nothing as CONV_ID won't match a 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
To get the conversation ID of a conversation, use the command: `/bot whereami`
- `plugins`
"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`
- plugins in sub-folders
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
Note that 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`
"watch_new_adds": false
# monitoradds plugin will not monitor user adds/joins
Determines the state of user add monitoring by the [Monitor]
(https://github.com/hangoutsbot/hangoutsbot/wiki/Monitoradds-Plugin) plugin
This key is supported as a [**per-conversation]
(https://github.com/hangoutsbot/hangoutsbot/wiki/Configuration#conversations)
- Others
- `chatlogger.path`
- `commands_admin`
- [ver]** Make listed commands 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_admin)
- `commands_tagged`
- `commands_user`
- [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)
- `commands.tags.deny-prefix`
- `language`
When not set, the default language is English (untranslated).
Depending on the status of the [translation](https://github.com/hangoutsbot/hangoutsbot-locales),
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`
- `memory-failsafe_backups`
maintained by the bot on every `memory.json` write
To disable backups entirely, use string `"0"` e.g. `"memory-failsafe_backups": "0"`
- `memory-save_delay`
To disable the delay entirely, use string `"0"` e.g. `"memory-save_delay": "0"`
- `mods`
(https://github.com/hangoutsbot/hangoutsbot/wiki/Monitoradds-Plugin) plugin
This key is supported as a [**per-conversation](https://github.com/hangoutsbot/hangoutsbot/wiki/Configuration#conversations)
Note: **Use of the `mod` key is not recommended**, we recommend [tagging](https://github.com/hangoutsbot/hangoutsbot/wiki/Reference:-User-and-Conversation-Tagging#basic-tag-manipulation) as **mod**s instead.
- `plugins.tags.auto-register`
- [ver]** [Access](https://github.com/hangoutsbot/hangoutsbot/wiki/Access-Control-with-Tags) - [Configures](https://github.com/hangoutsbot/hangoutsbot/wiki/Customising-Access-Control#pluginstagsauto-register)
Plugin List | Developer Reference: [ Intro | Plugins | Sinks | In-built Functionality | [Configuration] (Configuration) ]