Git Product home page Git Product logo

charlie's Introduction

Charlie - 18F's Hubot

This is a version of GitHub's chat bot, Hubot. Hubot's pretty cool.

What all it can do

coffee me Charlie will add you to the queue for virtual coffee, or if someone else is already in the queue, Charlie will match you up and send you each a DM!

@charlie define <term> or @charlie glossary <term>
Charlie will attempt to look the term up in the 18F Procurement Glossary and report what it finds

@charlie hug me or @charlie hug bomb <number>
Charlie will send you a picture of a hug-offering colleague, or several!

love @someone for the thing (or ❤️ or <3 them)
Charlie will exclaim about even more love, and will post in the #love channel

@charlie opm status
Charlie will check with OPM about whether or not DC offices are open today

@charlie set tock <tock line> or @charlie set tock line <tock line>
Charlie will associate the current channel to the given tock line

@charlie tock or @charlie tock line
Charlie will tell you what tock line is associated with the current channel, if any

giraffe/dag/cat fact Charlie will tell you something fascinating.

@charlie when is the next holiday? Charlie will tell you when the next federal holiday is

Plus more! Try sending a DM to Charlie with help for a full list!

Running Charlie locally

The easiest way to test Charlie locally is using Docker. First, create a .env file (see the .env-sample for reference) that sets, at minimum, the HUBOT_SLACK_TOKEN variable. (See the configuration section on environment variables below for a list of all the variables you can set.) Then, run docker-compose up. This will get all of Charlie's dependencies installed, setup a redis container, hook up Charlie and redis, and start Charlie up.

If you don't want to use Docker, you can run npm install from the root directory, set your HUBOT_SLACK_TOKEN environment variable, and then run sh start.sh. This is a minimum execution; to enable more features, you may need to set associated environment variables.

Deploying

18F's Hubot is named Charlie, and is deployed in Cloud.gov.

Charlie is set up with continuous deployment, just merge your code to main and it will get deployed with CircleCI.

Configuration

slack-github-issues

We use hubot-slack-github-issues to automatically create Github issues when certain emoji reactions are added to messages in certain channels. This is configured in config/slack-github-issues.json.

The <token> strings in the top part of the config are replaced by environment variables (see below) if provided. To add a new Github issue rule, add a new entry to the rules array. The properties are as follows:

name purpose
reactionName The name of the emoji in Slack that should trigger this issue, without the colons. For example, if you want :evergreen: to trigger an issue, this value should be evergreen.
githubRepository The name (and only the name) of the repository where the issue should be filed. The repo owner is taken from the top level of the config, in the githubUser property.
channelNames A list of channel names where this reaction will trigger an issue. This lets you limit responses to just certain channels. If this is not included, then Charlie will respond to the reaction in every channel.

Environment variables

name purpose
HUBOT_SLACK_TOKEN Required to connect to Slack.
HUBOT_GITHUB_TOKEN Required for Github integrations. For example, there's a script that will create a Github issue when certain emoji reactions are added to messages. This token must be set for that to work.
HUBOT_TOCK_API Required for Angry and Optimistic Tock bots.
HUBOT_TOCK_TOKEN Required for Angry and Optimistic Tock bots.
ANGRY_TOCK_TIMEZONE The timezone used for Angry Tock notifications for truant users. Defaults to America/New_York if unset.
ANGRY_TOCK_FIRST_TIME The time of day for the first reminder to Tock truants. This is sent at the same time to all truants, based on the timezone in ANGRY_TOCK_TIMEZONE.
ANGRY_TOCK_SECOND_TIME The time of day for the second reminder to Tock truants as well as supervisors. This is sent at the same time to all truants, based on the timezone in ANGRY_TOCK_TIMEZONE.
ANGRY_TOCK_REPORT_TO A comma-delimited list of channels or users to send the second truancy report to. Defaults to #18f-supes. Specify users with @username.
HUBOT_TWITTER_ACCESS_TOKEN_SECRET Used by the twitter stream integration
HUBOT_TWITTER_STREAM_ACCESS_TOKEN Used by the twitter stream integration
HUBOT_TWITTER_STREAM_CONSUMER_KEY Used by the twitter stream integration
HUBOT_TWITTER_STREAM_CONSUMER_KEY Used by the twitter stream integration
ADAPTER This should either be omitted or set to slack
HUBOT_SLACK_GITHUB_ISSUES_CONFIG_PATH Path to the file that configures the script that creates Github issues when emoji reactions are added. Defaults to config/slack-github-issues.json. The default is accurate for Charlie, but if you needed to override it for testing, you certainly can.
HUBOT_LOG_LEVEL Log level. When using Docker, this is set to debug.
REDIS_URL URL to redis, if desired. The URL should be of the form redis://:password@host:port - note that there is not a username before the password in this URL, because redis does not support usernames.

Documentation

General information about Hubot can be found here:

https://hubot.github.com/

Contributing

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.

charlie's People

Contributors

mgwalker avatar afeld avatar yozlet avatar stvnrlly avatar dlapiduz avatar wslack avatar tbaxter-18f avatar amoose avatar mogul avatar mbland avatar janearc avatar randyhart avatar dependabot[bot] avatar vishaliyer-18f avatar sawtoothwave avatar rahearn avatar monfresh avatar nkkl avatar adunkman avatar allisonnorman avatar annepetersen avatar ccostino avatar jcscottiii avatar jmcarp avatar vdavez avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.