A Clojure implementation of a poker game (Texas Hold 'em) and a corresponding Discord bot to play poker in chat.
This is (roughly) how the logic part is used:
(require '[poker.logic.game :as poker]
'[poker.logic.core :as cards])
(def player-budgets {"Alice" 100 "Bob" 85})
(def game (poker/start-game 10 (keys player-budgets) (shuffle cards/deck) player-budgets))
; Available functions
(poker/possible-moves game)
(poker/call game)
(poker/raise game 20)
(poker/fold game)
(poker/all-in game)
Here are a few impressions of what it looks like:
The bot is public, you can invite it here.
It is currently not guaranteed to be online 24/7 since some things may still change, but it should be online 99% of the time now.
You are also free to host it yourself (either manually or using Docker):
-
Get Leiningen (not needed for Docker)
-
Clone this repo
-
Put a
cofig.clj
file in the repo that looks like this:{:token "TOKEN" :default-wait-time 25000 ; The default number of milliseconds to wait for players when starting a game :default-buy-in 1000 ; The default buy-in if none is specified when running "holdem!" :default-timeout 180000} ; The default number of milliseconds after which the current player, if they have not made a move, will fold automatically
-
Run
lein run
ordocker-compose up
Note that your bot needs to be on the playing cards emoji server for it to work out of the box. I am not the owner of that server, so I can't help with adding your bot there. Please be mindful of the server owner and don't annoy them.
You can also use your own custom emojis. For that, you'll have to modify the emoji ids in poker.discord.display
.
Copyright © 2020-2021 JohnnyJayJay
This program and the accompanying materials are made available under the terms of the Hippocratic License 2.1 which is available at https://firstdonoharm.dev/version/2/1/license.html