CharlieHess / slack-poker-bot

A bot that deals Texas Hold'em games in Slack
MIT License
1.66k stars 206 forks source link

Slack Poker Bot Build Status

A bot that turns Slack into a legitimate Texas Hold'em client. Start a game in any channel or private group with 2-10 players. PokerBot will deal hands, direct message players with their hole cards, query players for their action, determine the winning hand, and handle the pot.

See it in action.

Getting Started

  1. Create a new bot integration
  2. Follow the steps to deploy the bot to Heroku or run it locally
  3. Once the bot is running, start a game with: @<your-bot-name>: deal

One-Click Heroku

Click this button:

Deploy

Manual Heroku

  1. Install Heroku toolbelt
  2. Create a new bot integration (as above)
  3. heroku create
  4. heroku config:set SLACK_POKER_BOT_TOKEN=[Your API token]
  5. git push heroku master

To Run Locally

  1. Create a token.txt file and paste your API token there
  2. npm install
  3. node src/main.js

Directions

Check the open issues for some planned enhancements.

AI Players

Although this client was built for managing human players in a Slack channel, it has some support for AI players. To add a bot player:

  1. Add a bot class under the ai/ folder
  2. Implement getAction, which is called whenever it is the bot's turn
  3. Modify the addBotPlayers method in src/bot.js to add your bot to every game

Test All The Things

To run tests, simply do:

  1. gulp

The tests produce legible output that matches what users in Slack would see. This is the same test suite that is run on each pull request. This is very helpful when diagnosing a logic bug:

Dependencies