···11-# SpinShare Speen Open Referee Bot
11+# SpinShare Refbot
22+23A Discord bot to help referees manage matches more easily!
3445## Setup
5667### Prerequisites
88+79- Node.js v24+
810- A Discord bot application with a token
911- A MongoDB instance
10121113### Installation
1414+12151. Clone the repository
13162. Run `npm i` in the root directory
14173. Create a `.env` file in the root directory:
1818+1519```env
1620DISCORD_TOKEN=tokenhere
2121+TEST_TOKEN=testbottokenhere
1722CLIENT_ID=discordbotapplicationidhere
1818-GUILD_ID=serveridhere
2323+TEST_ID=testdiscordbotapplicationidhere
2424+GUILD_IDS=serveridhere,andhere,maybemore
1925MONGODB_URI=mongodb://USERNAME:PASSWORD@URL:PORT
2626+MONGODB_TEST_URI=mongodb://USERNAME:PASSWORD@URL:PORT
2027WS_PORT=websocketporthere
2828+HTTP_PORT=webserverporthere
2129```
22302331### Running
3232+2433- `npm run deploy` - registers slash commands with Discord (run this whenever you add or change commands)
2525-- `npm run dev` - runs the bot in development mode with auto-restart on file changes
3434+- `npm run deploy-test` - same as above but for testbot
3535+- `npm run dev` - runs the TEST bot with auto-restart on file changes
2636- `npm start` - runs the bot in production mode
27372828-## Features
2929-- **/start** - starts a match, handling:
3030- - player check-in via dropdown
3131- - referee approval
3232- - random ban order selection
3333- - alternating ban phase until one map remains
3434-- **/restart** - restarts a previously completed match with the same map pool
3535-- **/result** - submits the result of the current chart
3636-- **/clean** - cleans up stuck or abandoned matches
3737-- **/refresh** - fetches the map pool from a Google Sheets URL and caches SpinShare chart data
3838-- **/generate** - generates all match pools for the tournament (maybe integrate this into `/refresh` instead?)
3939-- **/event** - creates, switches, and lists events
4040-- **/ping** - replies with "Pong!" and how long the command took to execute.
4141-- **/hostname** - replies with hostname of current environment
3838+## Commands
3939+4040+extras:
4141+4242+- `/commands` - Lists all available commands.
4343+- `/debugpools` - Debug the generated pools structure
4444+- `/hostname` - Replies current hostname
4545+- `/ping` - Replies with 'Pong!'
4646+4747+utility:
4848+4949+- `/clean` - Clean up stuck or abandoned matches.
5050+- `/config set-referee-role` - Set the role that is allowed to run referee commands.
5151+- `/event create` - Create a new event and set it as active.
5252+- `/event switch` - Switch to an existing event.
5353+- `/event list` - List all events.
5454+- `/event current` - Show the currently active event.
5555+- `/forceclean` - Force clean a stuck match from memory
5656+- `/generate` - Generate all match pools for the tournament.
5757+- `/refresh` - Refresh the map pool from a Google Sheets URL.
5858+- `/restart` - Restart a previously completed match.
5959+- `/result` - Submit the result of the current chart.
6060+- `/start` - Start the next match!
42614362## TO-DO
6363+4464In no order:
6565+4566- [x] Handle pick/ban cycle
4667- [x] Mappool generation/management
4768- [x] Ready checks
···5778- [ ] Simulate rolls because it's silly and fun! Should be interactive for the players
5879- [ ] Add a way to revert the last step (for example if someone reported incorrect scores)
5980- [ ] Make it more obvious who is "score1" and who is "score2"
6060-- [ ] Player stat tracking? (Use discord account ID?)8181+- [ ] Player stat tracking? (Use discord account ID?)