anseljh / casebot

Friendly Slack bot for looking up cases
GNU Affero General Public License v3.0
19 stars 4 forks source link

Casebot

Casebot is a robotic legal assistant for Slack that looks up cases, either by citation or name. It's written in Python, and is licensed under the Affero GPLv3 open source license.

Casebot in action

How to Use Casebot

Casebot will respond to direct messages, or to @-messages if you add it to a channel. Your message to Casebot should include just a case citation, or find and the name of a case (or part of it).

Examples

Limitations

Unfortunately, Casebot's legal education was somewhat abbreviated, so its citation lookup is fairly rigid. Casebot only knows how to look up well-formed citations, like 410 U.S. 113. For Casebot's purposes, a citation is broken into three parts:

Reporters are also case-sensitive: U.S. will work, but u.s. will not. Don't worry, a fix is in the works.

When using find, Casebot only returns the first result. It may not be what you were looking for!

Installation

Casebot runs on your own computer. This can be your own desktop or laptop, or a server. You could probably get it to run on Windows, but so far it's been tested on Mac and Cygwin (a Linux-like environment for Windows).

  1. If it's not already on your computer, install Python. Casebot was developed in Python 3, but it should also work on Python 2. If you're using a Mac, Linux, or Cygwin, you can skip this step because Python should already be installed.

  2. Create a Slack bot user at https://my.slack.com/services/new/bot. Write down the API token you get.

  3. Edit the settings.ini file and paste in your new API token after the equals sign on the line that starts with slack_token:

    slack_token=YOUR_BOT_API_TOKEN
  4. Install the Python packages that Casebot needs. In a terminal:

    pip3 install -r requirements.txt
  5. In the same terminal, run the program, using Python:

    python3 casebot.py
  6. You should see your bot come online in Slack. Send it a test message!