This guide assumes you have the correct version of Node installed as specified in .nvmrc
, perhaps via nvm and nvm use
.
Start by cloning this repo.
gh repo clone Adventure-Bot/adventure-bot
git clone git@github.com:Adventure-Bot/adventure-bot.git
yarn
or npm i
Follow this guide: Setting up a bot application
You should now have a bot token.
cp packages/game/.env.sample packages/game/.env
Replace the BOT_TOKEN
value with the your bot token.
Follow this guide: Adding your bot to servers
The permissions required are 536334563408
.
You can replace YOUR_CLIENT_ID_HERE
in the URL below to create an invite link for your bot.
https://discord.com/api/oauth2/authorize?client_id=YOUR_CLIENT_ID_HERE&permissions=536334563408&scope=bot%20applications.commands
Visit the link to be prompted to add the bot to your server. Follow the prompts.
You should now have a bot in your Discord server.
Adventure Bot uses Yarn Workspaces. You may run commands in any particular workspace via the aliases web
and game
. For example, to add a dependency to game: yarn game add <dep>
, or to run build web: yarn web build
, etc.
Build all workspaces.
yarn build
Start development for all workspaces.
yarn dev
Lint all workspaces.
yarn lint
Check formatting for all workspaces.
yarn format
Fix the formatting for all workspaces.
yarn format:write
Start the Discord bot.
yarn game start
Transpile TS to JS.
yarn game build
Build, serve, and watch for changes.
yarn game dev
Compile the Next.js application.
yarn web build
Start the built project.
yarn web start
Build, serve, and watch for changes.
yarn web dev
To start a Redux Devtools server:
yarn redux-devtools
You can hit F5 to Run and Debug in VS Code to debug the application. Add debugger
to the code or add breakpoints to step through code line by line.