Skip to content

jonhoo/hanabot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a Slack bot that allows users to play the cooperative card game Hanabi with one another.

Slack gameplay screenshot

Installation

  1. Download and install Rust.

  2. Create a new bot user here.

  3. Note down the bot user's API Token.

  4. Invite the bot user to a channel called #hanabi (it may be private).

  5. Run the bot with

    $ env "API_KEY=XXX" cargo run

    where XXX is the API token from step two.

At this point, the bot should make an announcement in #hanabi that players can join.

Usage

Players must first notify the Hanabi bot that they wish to play. They do so by sending the bot join in a direct message. If you no longer wish to participate in games, use leave.

The bot will try to construct games of five players. Once there are two or more players, any player can instruct the bot to start, which causes it to start a game with however many players are available. A player can only be in one game at any given point in time.

During play, a player can play, clue, and discard:

  • To play, use play <card>, where <card> is the index of the card you wish to play from the left, starting at 1
  • To discard, use discard <card>, where <card> is the same as for play.
  • To clue, use clue @player <specifier> where @player is the user to clue, and <specifier> is either a color (e.g., red), or a number (e.g., two). The leading clue keyword is optional.

In addition, use hands to show all players' hands, and what each player knows about their hand, discards to show the discard pile, deck to show the number of cards left in the deck, and ping to remind the current player that it's their turn. You can also terminate the current game using quit.

When new cards are drawn, they appear on the right-hand side of your hand.

Known limitations

  • No spectator mode.
  • No support for playing with the rainbow suit.
  • No support for playing with character cards.
  • No long-term statistics tracking.

All of these are fixable. PRs are welcome.

About

Hanabi Slack bot

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages