Skip to content

tsvikas/hanagram

 
 

Repository files navigation

Hanagram

Tests uv Ruff Black
Made Using tsvikas/python-template GitHub Discussion PRs Welcome

Overview

Telegram bot to play Hanabi with your friends.

Usage

  • Get an API TOKEN from @BotFather
  • Save to the .env file:
cp .env.sample .env
nano .env  # set the API TOKEN

And run the server with uv

uv run play-telegram

Telegram game

How to play a Telegram game:

  • Add the bot to a telegram group.
  • All players should start a private chat with the bot. Send /link_for_newbies to help them do it.
  • Send /new_game in a group chat to create a new game.
  • Users can now join the game with the Join button displayed.
  • When everyone joined, send /deal_cards to start playing!

Alternatively:

  • Send /test <number-of-players> in a private chat.

Local game

How to play a local game. Let's say players are Alice, Bob and Casey.

  • Run uv run play-repl Alice Bob Casey
  • On each turn, type one of those actions:
    • play <index of card to play>
    • discard <index of card to play>
    • hint <player name to hint> <color or value>

Development

Getting started

  • install git, uv.
  • git clone this repo: git clone tsvikas/hanagram.git
  • run uv run just prepare

Tests and code quality

  • use uv run just format to format the code.
  • use uv run just lint to see linting errors.
  • use uv run just test to run tests.
  • use uv run just check to run all the checks (format, lint, test, and pre-commit).
  • Run a specific tool directly, with uv run pytest/ruff/mypy/black/...

About

Telegram bot to play Hanabi with your friends.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 95.0%
  • Just 4.5%
  • Dockerfile 0.5%