Skip to content
azzimodaPublic

About

Telegram bot for solving a Rubik's cube (Go)

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rubix-bot

Telegram bot for solving a Rubik's cube.

How it works

  • /start — begins a new game: a fresh 3x3 cube is scrambled and sent as a rich message with the rendered cube, a collapsible move log and move buttons. An optional scramble can be given, either as notation moves (/start R U F' L) or as a scramble length (/start 40); /start alone produces a random scramble.
  • Tap the move buttons (F, F', B, B', U, U', D, D', L, L', R, R') to rotate the cube. The board is redrawn in place after every move and the move log grows without length limits.
  • Once the cube is solved, the bot congratulates you.
  • /stats — shows your finished-game statistics (total, solved vs abandoned, average and best move counts).
  • /stop — ends your current (active) game. Finished games are kept for reference; send /start to play again.
  • /help — shows available commands.

The picture shows the cube from two orthographic perspectives side by side with the unfolded net in the corner. The board is delivered as a Telegram rich message: the cube photo, a collapsible move log and the move buttons are all part of the same message and are updated with a single edit per move. Sessions, the scramble and every applied move are persisted so a game survives restarts.

Ended games — both solved and abandoned — are kept as history for later analysis. History per chat is bounded to the newest HISTORY_LIMIT_PER_CHAT ended sessions; the active game is never trimmed.

Configuration

Environment variables (loaded from .env if present):

  • BOT_TOKEN — required, Telegram bot token.
  • LOG_LEVEL — optional, zerolog level (default info).
  • DB_PATH — optional, path to the SQLite database (default rubix.db).
  • HISTORY_LIMIT_PER_CHAT — optional, ended sessions kept per chat (default 500).
  • SHUTDOWN_TIMEOUT — optional, grace period for in-flight work on shutdown (default 5s).
  • SOCKS5_PROXY — optional SOCKS5 proxy address (host:port or socks5://host:port). Empty means a direct connection.
  • SOCKS5_USER / SOCKS5_PASS — optional credentials for an authenticated SOCKS5 proxy.

Run

cp .env.example .env   # set BOT_TOKEN
go run ./cmd/bot

Roadmap

  • Multiplayer voting mode: several users solve one cube together by voting for the next move.
  • Per-move move-count column to offload stats aggregation to SQL.

About

Telegram bot for solving a Rubik's cube (Go)

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages