First minigames bot for Echoed.
npm install
cp .env.example .env # add your zbot_ key
npm startRequires Node.js 20+ (uses node:sqlite).
| 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.
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
npm test