Skip to content
Innocent Bystander edited this page Aug 8, 2015 · 30 revisions

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.

  1. Default
This is the default configuration that is installed with every new bot. It also reflects the minimum
  configuration required to get the bot working.
    1. `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.
    1. `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).
    1. `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).
    1. `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`

    1. `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`
      1. plugins in sub-folders
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

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`.
    1. `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)
  1. Others
All other keys that can be added to the bot configuration and that are not set by default.
    1. `chatlogger.path`
Sets the path for [chatlogger](https://github.com/hangoutsbot/hangoutsbot/wiki/Chatlogger-Plugin) plugin to store conversation logs
    1. `commands_admin`
    1. `commands_tagged`
This key is supported as a [**per-conversation](https://github.com/hangoutsbot/hangoutsbot/wiki/Configuration#conversations)
    1. `commands_user`
This key is supported as a [**per-conversation](https://github.com/hangoutsbot/hangoutsbot/wiki/Configuration#conversations)
    1. `commands.tags.deny-prefix`
    1. `language`
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](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`

    1. `memory-failsafe_backups`
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"`

    1. `memory-save_delay`
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"`

    1. `mods`
Contains a list of user ids designated as **mod**erators, used 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)

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.

    1. `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)

# ## ###

Clone this wiki locally