Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tuna

First minigames bot for Echoed.

Setup

npm install
cp .env.example .env   # add your zbot_ key
npm start

Requires Node.js 20+ (uses node:sqlite).

Commands

Command Description
!2048 [image|text] Start 2048. Without an argument the bot asks for a board style.
!stop Stop your running game and save the score.
!stats Your games, wins and best score.
!top Top 10 by best score.
!help List commands.

Games are controlled with reactions: ⬆️ ⬇️ ⬅️ ➡️ to move, ⏹️ to stop. Text mode redraws in one API call; image mode uploads a rendered PNG per move, so it is slower but prettier.

Layout

src/
  index.js            entry point — validates the token, wires the gateway
  config.js           endpoints, prefix, colours, db path
  db.js               node:sqlite — player stats and match history
  echoed/
    api.js            REST wrapper for the Bot API
    gateway.js        Socket.IO connection, auth and heartbeat
  commands/
    index.js          command registry and dispatch
  games/
    sessions.js       maps message ids to running games for reaction routing
    2048/
      board.js        pure game rules — no I/O
      game.js         session: move queue, embeds, lifecycle
      render.js       board to PNG
test/                 board rules and move-queue tests

Tests

npm test

About

First minigames bot for Echoed

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages