
Slack Poker Bot - CharlieHess
https://github.com/CharlieHess/slack-poker-bot
======
vinothgopi
Feature request: zenpayroll integration

~~~
ljk
is there a way to spin it so it'll be legal in the US?

~~~
slg
It varies by state, but home poker games often aren't expressly illegal. The
illegal aspect is often profiting off of running the poker game. As long as
you don't implement a rake into the system and you are paying out the entire
pot, you are probably good from a legal perspective although IANAL.

~~~
FireBeyond
When I played poker at MSFT in WA state, another rule was that you couldn't
bet truly blind. You had to at least look at your cards. To see your cards and
bet was a 'game of skill', to not was 'gambling'.

~~~
an4rchy
That's what gives away the tell... I'd say reading people is probably the more
relevant skill than counting odds...

~~~
tP5n
No, that's not how poker is played, it really is about counting odds and
evaluating the possible plays. Unless you were kidding of course and I'm far
to sleepy again.

------
purephase
While not a poker player, I can't help respect the why-the-fuck-not? aspect of
this. Very cool.

------
Wingman4l7
The title confused me for a minute. In IRC chat circles, "bot" means a
persistent software entity running in the channel, performing some task. In
online poker circles, "bot" means software that automatically plays for you.

~~~
pavel_lishin
This has support for both!

------
lotyrin
The attention to detail in spec output is exemplary.

Uploading to Imgur for displaying card images to users seems like a strange
choice, though. Why not have the bot serve its own images up over HTTP and
attach URLs to itself? I could even imagine a badges.io style image
preparation microservice that could be shared by several playing-card based
bot apps.

~~~
GauntletWizard
Possibly because running a bot client is much different from running a
webserver. Dialing outbound to connect to slack is much easier than figuring
out or configuring your own canonical URL, opening ports, etc.

On the other hand, preparing hands as a single image seems a bad way of doing
this; Does the slack API only allow a single image per conversation? I agree
with your preparation microservice idea - There should be (and probably are
several) a service that allows you to specify a poker hand as a query string
and get back an image of the hand. More simply, though: A webfont and
[https://en.wikipedia.org/wiki/Playing_cards_in_Unicode](https://en.wikipedia.org/wiki/Playing_cards_in_Unicode)

~~~
TazeTSchnitzel
Are images even necessary, anyway?

Unicode has playing card codepoints (the full 52) and playing card house
codepoints (️, ️, ️, ️).

Edit: What the hell? Hacker News stripped the Unicode characters?!
[https://news.ycombinator.com/item?id=10156894](https://news.ycombinator.com/item?id=10156894)

~~~
CharlieHess
You can't control the font rendering in Slack (it's Lato, at a certain size).
The Unicode cards are far too small to read.

~~~
TazeTSchnitzel
I did think of that. But you could use the symbols for the houses and pair
them with a number/letter.

------
flakmonkey
Am I correct in saying that the shuffle algorithm is flawed? It looks to me
like it swaps each card iteratively with a random card in the deck. This means
that some cards are likely shuffled more times that others, and some sequences
are then more common than others.

[https://github.com/CharlieHess/slack-poker-
bot/blob/master/s...](https://github.com/CharlieHess/slack-poker-
bot/blob/master/src/deck.js)

~~~
CharlieHess
Thanks for spotting that! Fixed here: [https://github.com/CharlieHess/slack-
poker-bot/commit/332f39...](https://github.com/CharlieHess/slack-poker-
bot/commit/332f393ac7527800036ca24bf5b76d84af531a41)

~~~
avree
Since you already have the card images, any chance of having it deal actual
card images versus the abbreviated format?

I can look into doing this myself and submitting a PR after I get home, as
well.

~~~
CharlieHess
Are you talking about the hole cards that are DM'ed to you? That's a good
suggestion; feel free to file an issue.

------
julbaxter
Request: Planning poker integration to vote for story point

------
hmate9
Request: Battleship for Slack

~~~
an4rchy
Yes! Also, this might be a new genre of slack integrations.. games....
:lightbulb:

~~~
latj
I have never used slack. How is it different than IRC?

~~~
91bananas
Just a way better interface on it. Searchable history, multiple rooms inside
rooms effectively. File sharing, lots of niceties that are probably possible
in IRC but would take a lot of work. It has changed the way our team
communicates, for me I am the only remote guy on a team of 6ish devs. I can
pick and choose my hours, work when other guys are off, and still see all the
comms that happened while I wasn't at my machine.

~~~
vacri
I love everything about Slack except the damn chat window. Oh, and the
pricing. The onboarding process is buttery smooth, and there are tons of
integrations. But there's so little in the way of communication density (even
in 'compact mode') that I miss IRC.

We have a jira integration set up and every ticket consumes five lines plus
plenty of whitespace - a few of those and there's no real comms visible on the
page. Every integration I've see consumes gobs of space. Similarly, flagging
announcements by assigning a colour is almost worthless - the colour bar isn't
very visible (I prefer hipchat's method, where the entire chatline gets the
background colour set). Then there's the problem of people's actual chat
messages being the least visible thing on the page - smaller and less
noticable than names, integration notifications, what have you. But the
onboarding is so easy, it just sucks users up.

Being able to see a conversation instead of bells and whistles? I miss that...
but plain text scares regular users...

~~~
tomaskafka
Could you run Slack web in Chrome, and find or make a userstyle that would
tighten it up?

[https://userstyles.org/styles/browse/slack](https://userstyles.org/styles/browse/slack)

------
0xCMP
Watch, soon we'll see articles about how "Slack built a platform..." and how
the next big things are games for slack /s

~~~
bbcbasic
Or how Slack, like Facebook gets banned at many workplaces.

------
spelunker
Feature request! HipChat integration!

Shoot, I'll just do it myself.

~~~
gbin
why not use a generic chatbot like errbot
([http://errbot.net](http://errbot.net) [shameless plug alert]) and get all
the backends (hipchat, IRC, XMPP etc...) for free ? there are existing poker
AIs in python to integrate with: [https://github.com/mikaelbr/AI-Poker-
Player](https://github.com/mikaelbr/AI-Poker-Player)

~~~
CharlieHess
Because the fun part was writing the game logic, not the glue code. ;)

~~~
gbin
it was re:the comment, not the OP. I totally understand :)

------
a_t48
Tried it - it crashed for both games we tried. Then again, installing node on
my box was a mess - we have some sort of proxy on apt-get that insisted on
installing an old version. I probably screwed up somehow.

Edit: [https://github.com/CharlieHess/slack-poker-
bot/issues/14](https://github.com/CharlieHess/slack-poker-bot/issues/14)
[https://github.com/CharlieHess/slack-poker-
bot/issues/22](https://github.com/CharlieHess/slack-poker-bot/issues/22)

Glad I'm not the only one.

~~~
CharlieHess
Wrote up a workaround until I can fix it properly.

------
AlexSolution
Feature request: bitcoin integration

~~~
kordless
My thought exactly. But first, I'm containerizing it.

------
cpr
Nifty!

Why not define a bunch of custom emoji, one for each card, and use those
instead of the big graphics at each turn? Would save massive bandwidth.

~~~
im3w1l
There are unicodes for the cards, e.g. 🂶🃆. Does slack support color text?

------
0xCMP
This is pretty awesome though. I got a list of games I want to make for our
Python bot.

Number guess, blackjack, this, now maybe battleship...

------
thomasfromcdnjs
This is so good, I got it working in less than a minute. My team is going to
have a blast with this.

~~~
jakejake
Cool! Do you have a public server that's running the bot, or do you just run
it on your local machine?

~~~
CharlieHess
You can deploy via Heroku now, thanks to gangstead.

~~~
gangstead
Tested it out in the office. Productivity killed.

------
awinder
Very cool! Threw together a quick docker image if anyone finds it useful
[https://hub.docker.com/r/awinder/slack-poker-
bot/](https://hub.docker.com/r/awinder/slack-poker-bot/)

------
kordless
I've ported this to run on Giant Swarm: [https://github.com/giantswarm/swarm-
holdem](https://github.com/giantswarm/swarm-holdem). That repo also supports
running it locally in a container.

------
Pwntastic
I can't seem to get it installed on windows 8.1... The lwip package in one of
the other dependencies fails to build :( sad day

~~~
CharlieHess
Does the Heroku deploy work for you?

~~~
Pwntastic
The Heroku deploy does appear to work, but I was hoping to get it all running
locally. Thanks though! It looks like there's a ticket on the lwip project on
github that is similar to my issue, so hopefully they'll resolve that soon
enough :)

------
binaryblitz
Anyone having an issue with npm doing this: FATAL ERROR: JS Allocation failed
- process out of memory

------
Yhippa
Super awesome! A few buddies and I use TriviaBot. So much fun. Can't wait to
install this.

------
companyhen
As a new dev: How do I get npm install to run? I'm on step 4 of the
instructions.

~~~
kelyvin
Make sure you have node and npm installed on your machine. (You can check by
running "npm -v" from the command line, if you don't see anything, then take a
quick google search on how to install it).

Run "npm install" in the folder directory where the package.json is visible.
In this case, if you cloned or extracted this project, it would be in the
slack-poker-bot folder.

Hope that helps!

~~~
companyhen
Figured it out myself! Thanks :)

------
d2xdy2
This is pretty neat. I just hope no one gets in trouble at work playing poker.

------
genericacct
Great I was just looking for something to feed to my machine learning thesis.

------
samirez
@Charlie - How do I get in this SF Utes slack channel? :) Go Utes!

------
ezarowny
Would you be open to a PR adding HipChat support?

~~~
CharlieHess
Certainly not opposed; it's pretty tightly coupled to the Slack API, though.

------
ykumar6
Installed 30 minutes ago, entire team hooked

------
disillusioned
Hoping someone does this with chess, too!

------
orky56
Slack off with some poker!

------
deeteecee
id love it if i can do this in only private chat lol

