Skip to content

Commit 217adb3

Browse files
committed
Add local dev documentation to readme
1 parent 8772057 commit 217adb3

File tree

1 file changed

+38
-1
lines changed

1 file changed

+38
-1
lines changed

README.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,41 @@
11
# crowbartools-discord-bot
22
A bot that helps service the Crowbar Tools Discord server.
33

4-
![Tests](https://github.com/crowbartools/crowbartools-discord-bot/workflows/Tests/badge.svg?branch=master)
4+
![Tests](https://github.com/crowbartools/crowbartools-discord-bot/workflows/Tests/badge.svg?branch=master)
5+
6+
7+
## Local Development
8+
9+
### Prereqs
10+
- Clone the repo
11+
- Run `npm install`
12+
- Create a test server in Discord, if you don't already have one. This is where you'll eventually install your local bot to and can test commands in.
13+
14+
### Setting up .env
15+
- Duplicate the **example.env** file and rename it to just ".env"
16+
17+
### Create a test discord bot app
18+
- Sign into the [Discord Dev Portal](https://discord.com/developers/applications)
19+
- Create a new Application, call it whatever you like (eg "TestCrowbarBot")
20+
- Add the app to your server
21+
- In the settings area of the newly created app, go to the "Installation" tab.
22+
- Uncheck "User Install" under **Installation Contexts**
23+
- Under **Default Install Settings**, add the "bot" scope and add the "Administrator" permission
24+
- Copy the **Install Link** and paste it in a browser
25+
- This should open up Discord with a prompt to install your application in a server.
26+
- Select your test server, click Continue, and then click Authorize (don't uncheck any permissions)
27+
- Update discord .env vars
28+
- Bot App Id
29+
- In the settings area of the newly created app, go to the "General Information" tab
30+
- Copy the **Application ID** and paste in your .env for `DISCORD_BOT_APP_ID`
31+
- Discord Token
32+
- In the settings area of the newly created app, go to the "Bot" tab
33+
- Under the "Token" section, click **Reset Token** and then copy the new value and paste in your .env for `DISCORD_TOKEN`
34+
- Discord Server (Guild) ID
35+
- Open up Discord, right click the icon for your test server and select "Copy Server ID", paste it in your .env for `DISCORD_GUILD_ID`
36+
- If you don't see the copy option, you probably need to enable Developer Mode in Discord (Settings > Advanced > Developer Mode)
37+
- All other env vars can be left empty unless you need to test those specific features (eg github issue creation, sent to questions/issues commands, etc)
38+
39+
### Run the bot
40+
- `npm run dev`
41+
- You should now see the bot show as "online" in your test server and slash commands should now be available to run

0 commit comments

Comments
 (0)