Skip to content

CivicTechTO/civictechto-chatbot

Repository files navigation

Roobot: CivicTechTO Chatbot

👋🖖 A friendly chatbot that lives in Civic Tech Toronto's Slack team. 💬🤖

Technologies Used

  • Coffeescript. A little language with syntactic sugar that compiles into JavaScript.
    • Hubot. A chatbot framework for running/creating shared tasks.
  • Heroku. A platform for easily deploying applications.
  • Slack. A user-friendly chat tool for large teams and communities.

Commands & Helper Scripts

See scripts/ for the set of custom commands/scripts enabled for our chat bot.

Note for screenshots: Our chatbot was previously named "toby".

calendar-add.coffee

This command allows any member of our Slack team to easily add events to a shared community Google calendar via:

>>> @ourbot gcal add https://eventbrite.com/xxxxxxxxxxxxx

This depends on another small service for parsing event data from urls: https://github.com/CivicTechTO/event-metadata-parser

For now, this service only knows how to make sense of events on the EventBrite and Universe platforms, but it could be improved to cover other platforms.

collab-tweeter.coffee

This script watches for Twitter links in top-level channels, and offered to RT from organizational account

screenshot of chat bot offering to tweet

quicklink-gsheet-lookup.coffee

This bot command recognizes messages of the format !keyword and looks up the keyword in a designated spreadsheet (like this one). It replies with the URL. Using !!keyword will reply with a hidden message than only the user who typed the message will see.

This relates to a scheduled task that we run, which updates our shortlinks from this spreadsheet: https://github.com/civictechto/civictechto-scripts#gsheet2shortlinkspy

sms-doorbell.coffee

We have an internet number set up to notify us our chat channel whenever someone texts us. We use this as a doorbell at meetups, so that all organizers can easily take responsibility for answering and dealing with issues.

It lives in its own code repository, so please see the civictechto/hubot-sms-doorbell README for full details

task-runner.coffee

This bot command is used to manually kickstart scripted jobs or tasks, which are otherwise usually scheduled to run at certain times. These scripts are run by CircleCI, and in our case, are defined in the CivicTechTO/civictechto-scripts repo and accompanying config file. The command allows this ability through the use of CivicTechTO/circleci-job-runner, a small app that offers an API for initiating these runs. There is no authentication on these tasks, and so it's assumed that all tasks are safe to run at any time.

screenshot of task-runner chatbot command

livestream.coffee

Screenshot of interacting with the livestream command

This command is intended to make it easy for almost anyone to run livestreaming. It offers commands for:

  1. assisting with instructions and configuration,
  2. setting the event title on the video

Contributing

This app is hosted on the Heroku platform, and configured using their automatic deployment feature.

This means that pushing or merging changes specifically to the master branch will make the changes live within several minutes.

FAQ

How do a rename this chatbot?

You'll need to change the name in several places, some of which are critical ⭐ and some of which are just to keep things consistent:

Can I rename the Heroku app?

Yes, but just note that you'll need to update some configuration for our SMS doorbell. Specifically, you'll need to re-point our internet number's SMS URL Callback. Details on this configuration/setup linked from CivicTechTO/hubot-sms-doorbell.

Releases

No releases published

Packages

No packages published

Languages