Guide: Blacklists and Whitelists
June 3, 2020 by @devth
June 3, 2020 by @devth
Yetibot exposes a plethora of commands ranging from weather
and wolfram
lookups to meme
generation to stock
prices to simple text manipulation and much more. Some operators may not want to expose the full range of Yetibot capabilities to their users, whether for security, or simplicity, or other reasons.
Now operators can intentionally expose any subset of Yetibot that they'd like via config. Thanks to @gkspranger for helping us work through this by providing lots of thoughtful feedback and feature requests! PRs that enabled these changes are:
When whitelist is configured, all commands are disabled except those present in the whitelist
collection, plus any foundational commands. Example config:
:yetibot-command-whitelist-0 "echo"
:yetibot-command-whitelist-1 "list"
When blacklist is configured, all commands are enabled except those present in the blacklist
collection, plus any foundational commands. Example config:
:yetibot-command-blacklist-0 "echo"
:yetibot-command-blacklist-1 "list"
We intentionally excluded a few commands from whitelists and blacklists as they are foundational or could be considered meta commands:
help
- meta command that lets users know which commands are available, and how each command works.alias
- aliases are all about composing or parameterizing other commands.channel
- command for working with channel-specific settings.category
- meta command for working with available commands according to their category.Related to curating the set of available commands, we can also configure the fallback command (i.e. what happens when a user tries to run a command that doesn't exist). This example sets it to an alias:
:yetibot-default-command "custom"
In the previous section, notice the output of !help
includes:
✅ Fallback commands are enabled, and the default command is
custom
. This is triggered when a user enters a command that does not exist, and passes whatever the user entered as args to the fallback command.
This is the default snippet of help text for fallback commands, but this too is overridable:
:yetibot-command-fallback-help-text "Welcome to Yetibot 👋"