Skip to content

Latest commit

 

History

History
138 lines (85 loc) · 2.51 KB

developer-guide.md

File metadata and controls

138 lines (85 loc) · 2.51 KB

Developing Adventure Bot

Prerequisites

This guide assumes you have the correct version of Node installed as specified in .nvmrc, perhaps via nvm and nvm use.

Clone this repo

Start by cloning this repo.

gh repo clone Adventure-Bot/adventure-bot
git clone git@github.com:Adventure-Bot/adventure-bot.git

Install dependencies

yarn or npm i

Create your bot token

Follow this guide: Setting up a bot application

You should now have a bot token.

Setup your .env

cp packages/game/.env.sample packages/game/.env

Replace the BOT_TOKEN value with the your bot token.

Invite the bot to your server

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.

Commands

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.

Global Commands

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

Game Commands

Start the Discord bot.

yarn game start

Transpile TS to JS.

yarn game build

Build, serve, and watch for changes.

yarn game dev

Web Commands

Compile the Next.js application.

yarn web build

Start the built project.

yarn web start

Build, serve, and watch for changes.

yarn web dev

Redux Devtools

To start a Redux Devtools server:

yarn redux-devtools

Debugging

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.