Coder Social home page Coder Social logo

swarm-holdem's Introduction

Holdem: A Poker Playing Slack Bot

This repository contains a service deployment for running Charlie Hess' Slack Poker Bot. If you want to run the bot on something besides containers, head over there and follow the instructions.

Prerequisites

At a minimum you will need the following to launch the software:

Note: Giant Swarm's shared public cluster is currently in private alpha. Ping me on Twitter if you need your application pushed through!

Video Walk-through

What's better than a nice pickup game of Texas Holdem? How about a video about a containerized Texas Holdem? Yeeehaww!

Getting Started

This won't take long. You'll need to start by heading over to your Slack account settings and doing the following:

  1. Navigate to https://<slack_account>.slack.com/services/new/bot.
  2. Choose a username for your bot and click add bot integration.
  3. Customize the icon and description for the bot.
  4. Copy the API token.

Build and Launch Locally

Assuming you have git installed, you'll need to clone this repository to your computer:

$ git clone https://github.com/giantswarm/swarm-holdem.git

Change into the swarm-holdem directory:

$ cd swarm-holdem

Edit the Makefile and change the TOKEN value to be the token you copied from the last step above:

$ vi Makefile

# standard info
PROJECT = holdem
REGISTRY = registry.giantswarm.io
USERNAME := $(shell swarm user)
ORG := $(shell swarm env | cut -d/ -f1)
SLACK_TOKEN="ycxb-10021122097-Nw7snCaadfaf370UpvcS5tFkNCg"

Note: That's a fake token in there. Change it to the token you copied earlier.

Run & Push the Bot

Now let's run the bot locally:

$ make run

You should see some activity and shortly this will appear:

##############################################
Your service holdem will be running via Slack.
##############################################

You should be able to interact with the bot on Slack as long as you keep it running on your local machine. If you want to run it longer, push it up to Giant Swarm:

$ # make sure you are logged in
$ swarm info
Cluster status:      reachable
Swarm CLI version:   0.19.1
Logged in as user:   kord
Current environment: kord/alt
$ 
$ # now push it
$ make up

More magic happens. After a bit, Giant Swarm will report:

Creating 'holdem' in the 'kord/alt' environment...
Service created successfully!
Starting service holdem...
Service holdem is up.
You can see all components using this command:

    swarm status holdem

##########################################################################
Your service 'holdem' will be running via Slack.
##########################################################################
superman:swarm-holdem kord$ swarm status holdem
Service holdem is up

At this point you can safely play poker with your new bot. Start by saying hello to the bot by DM'ing him, and then in a channel of your choice, type:

@johnny: Deal

If you want your bot to stop the game, enter this:

@johnny: Quit game

swarm-holdem's People

Contributors

kordless avatar

Watchers

 avatar  avatar

Forkers

stone-z

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.