Generalized random responder (replacing dag bot) #155
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds a generalized, configurable script to autorespond to different triggers. Removes the specific dag bot and replaces it with a configuration for the new autoresponder script. Moves dag facts to another repo. This paves the way for cat bot to be cool like dag bot.
Configuration
In
config/slack-random-response.json
is an array of responses. A response is defined with an object that looks like this:responseList
orresponseUrl
is required. If both are provided, onlyresponseList
is used.responseList
orresponseUrl
is required. If both are provided, onlyresponseList
is used.Response items
Strings
A response item can be a string or an object. If the response item is a string and it begins with
:emoji-name:
, then the specified emoji will be used as the bot's avatar for the response, and only the text after:emoji-name:
will be sent as the response. E.g.,":cat: Cats are animals"
producesIf it doesn't begin with an emoji, the bot will use the
defautlEmoji
from the config, or else it won't specify an avatar and will use whatever was configured in Slack.Objects
Response items can also be objects like this:
botName
property, they are combined intoname (botName)
E.g.,
on a config with
botName
set to "Kitty Bot" produces: