/pokebot

Hubot fork - play a text-based Pokémon game in slack!

Primary LanguageJavaScriptMIT LicenseMIT

pokebot-oak

pokebot-oak is a chat bot based on the Hubot framework. Originally generated by generator-hubot. Configured for deployment on Heroku.

Resources:

Heroku

Hubot

Hubot Yeoman Generator

Change adapter

Hubot Adapters

Deployment help

Deploy with Node

Deploy on Heroku

Deploy on Unix

Deploy on Windows

Adding scripts

Scripting Guide

  • Find new scripts with:

npm search hubot-scripts ______

Troubleshooting

If you're having issues, adding this line to your bin/hubot or Heroku .env file to see dev debug info:

export HUBOT_LOG_LEVEL="debug"

Running Locally via terminal

  • Clone the repospity:

git clone git@github.com:Studnicky/pokebot.git && cd pokebot

HUBOT_HEROKU_KEEPALIVE_URL = (your heroku app url)

HUBOT_SLACK_TOKEN = (your slack API token)

  • Install prereq's (requires npm and node to be installed globally)

npm install

  • To test locally in terminal, start pokebot with gulp:

gulp run-local

You'll see some start up output and a prompt:

[Sat Feb 28 2015 12:38:27 GMT+0000 (GMT)] INFO Using default redis on localhost:xxxx pokebot>

  • Talk to pokebot

pokebot> pokebot help

Using a local postgres install

sudo -u postgres psql

  • Make a new user and database for Pokebot

postgres=# CREATE USER pokebot CREATEDB pokebot CREATEUSER PASSWORD 'oak';

  • Exit and log back in as pokebot:

postgres=# \q

psql -h localhost -U pokebot

Database import instructions coming soon

Extra Configuration

A few scripts (including some installed by default) require environment variables to be set as a simple form of configuration.

Each script should have a commented header which contains a "Configuration" section that explains which values it requires to be placed in which variable. When you have lots of scripts installed this process can be quite labour intensive. The following shell command can be used as a stop gap until an easier way to do this has been implemented.

    grep -o 'hubot-[a-z0-9_-]\+' external-scripts.json | \
      xargs -n1 -I {} sh -c 'sed -n "/^# Configuration/,/^#$/ s/^/{} /p" \
          $(find node_modules/{}/ -name "*.coffee")' | \
        awk -F '#' '{ printf "%-25s %s\n", $1, $2 }'

How to set environment variables will be specific to your operating system. Rather than recreate the various methods and best practices in achieving this, it's suggested that you search for a dedicated guide focused on your OS.