SpinShare Refbot v1.3.27#
A Discord bot to help referees manage matches more easily!
Setup#
Prerequisites#
- Node.js v24+
- A Discord bot application with a token
- A MongoDB database
Installation#
- Clone the repository
- Run
npm iin the root directory - Create a
.envfile in the root directory:
DISCORD_TOKEN=tokenhere
TEST_TOKEN=testbottokenhere
CLIENT_ID=discordbotapplicationidhere
TEST_ID=testdiscordbotapplicationidhere
GUILD_IDS=serveridhere,andhere,maybemore
MONGODB_URI=mongodb://USERNAME:PASSWORD@URL:PORT
MONGODB_TEST_URI=mongodb://USERNAME:PASSWORD@URL:PORT
WS_PORT=websocketporthere
HTTP_PORT=webserverporthere
STARTGG=startggapikeyhere
Running#
npm run deploy- registers slash commands with Discord (run this whenever you add or change commands)npm run deploy-test- same as above but for testbotnpm run dev- runs the TEST bot with auto-restart on file changesnpm run start- runs the bot in production modenpm run dump-sets- dumps set data from start.gg eventsnpm run update-readme- updates README. used in CI
Commands#
extras:
/clean- Clean up stuck or abandoned matches./commands- Lists all available commands./debugpools- Debug the generated pools structure/hostname- Replies current hostname/ping- Replies with 'Pong!'/purge- Delete all bot messages in this channel./version- Replies with current version.
utility:
/config set-referee-role- Set the role that is allowed to run referee commands./event create- Create a new event and set it as active./event switch- Switch to an existing event./event delete- Delete an event. Cannot delete the currently active event./event set-slug- Set the start.gg tournament slug for this server./event list- List all events./event current- Show the currently active event./generate- Refresh the map pool and generate all match pools for the tournament./import- Import pre-generated pools from a result file./restart- Restart a previously completed match./result- Submit the result of the current chart./start- Start the next match!