-
Notifications
You must be signed in to change notification settings - Fork 2
Accessing and Writing config.json
Innocent Bystander edited this page Aug 8, 2015
·
1 revision
bot.config.exists(["<keyname>", "<keyname>", ...])
- checks whether
config["<keyname>"]["<keyname>"][...]
exists - returns
None
if the key path cannot be found
bot.get_config_option("<keyname>")
- gets value stored in
config["<keyname>"]
- returns
None
if<keyname>
cannot be found
bot.get_config_suboption("<conversation id>", "<keyname>")
- gets value stored in
config["conversations"]["<conversation id>"]["<keyname>"]
- if
<keyname>
cannot be found, retrieveconfig["<keyname>"]
(fallback tobot.get_config_option("<keyname>")
) - returns
None
if<keyname>
cannot be found in either location
bot.config.get_by_path(["<keyname>", "<keyname>", ...])
- retrieve configuration by the specified path hierarchy
- raises
KeyError
orTypeError
if keys don't exist
bot.config.set_by_path(["<keyname>", "<keyname>", ...], <somevalue>)
- raises
TypeError
if it cannot create the path - can only create a new key if all the preceding keys are available
- WARNING: INCORRECT USAGE OF THIS COMMAND CAN CORRUPT
config.json
- PLEASE USE WITH CARE
Plugin List | Developer Reference: [ Intro | Plugins | Sinks | In-built Functionality | [Configuration] (Configuration) ]