Skip to content

18F/charlie-slack-bot-facts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Charlie Slack bot facts and responses

This repo holds facts and autoresponses that feed into TTS's internal slack bot, Charlie.

How these lists work

These lists are JSON files that are read by Charlie. After creating a list here, you'll also need to update Charlie's configuration to read it. (See the documentation about the random responder for configuration information. If you're just updating a list Charlie already knows about, you can skip this step.)

The JSON file must contain a single array. Each element of the array represents one possible response to the configured trigger. For example, dags.json represents all the responses for the "Dag Bot," or facts about TTSers' dogs.

A response can either just be text or it can be a more complex object. If it is just text, you can specify an emoji to use as the bot's avatar by starting the text with the emoji. For example, the text ":cat: Cats are animals" would produce a message like this:

screenshot of bot response

If the text does not start with an emoji, the avatar will be the default for the bot, as configured in Charlie.

A response can also be a more complex object, specifying a name and avatar to use when posting along with the text of the response. For example:

{
  "name": "Dog in Disguise",
  "emoji": ":dog:",
  "text": "I am not a cat"
}

would produce a message like this:

screenshot of bot response

Note that if the bot is configured with a custom name in the Charlie configuration AND you set a name for this response, the bot's custom name is included in parentheses.

Contributing

See a short video demonstrating how to update the facts.

Changes must be submitted as pull requests, as the main branch is protected from direct edits. Pull requests must pass their tests before they can be merged - the tests just validate that the lists are correctly structured, so they should run pretty quickly. Once the tests pass, the pull request will merge itself.

Please read the contribution guidelines before submitting a pull request.

Public domain

This project is in the worldwide public domain. As stated in CONTRIBUTING:

This project is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the CC0 1.0 Universal public domain dedication.

All contributions to this project will be released under the CC0 dedication. By submitting a pull request, you are agreeing to comply with this waiver of copyright interest.