Skip to content

Commit 2cf717f

Browse files
committed
Add docs
1 parent 5ca8ec4 commit 2cf717f

10 files changed

+53
-9
lines changed

.github/config.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
// This file supports comments and trailing commas
33
"auth": {
4-
"clientId": "${CLIENT_ID}",
5-
"token": "${BOT_TOKEN}"
4+
"clientId": "${DISCORD_CLIENT_ID}",
5+
"token": "${DISCORD_TOKEN}"
66
},
77
"sentry": {
88
"dsn": null,

.github/workflows/CI.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ jobs:
117117

118118
- name: Update configuration
119119
env:
120-
BOT_TOKEN: ${{ secrets.CI_BOT_TOKEN }}
121-
CLIENT_ID: ${{ secrets.CI_CLIENT_ID }}
120+
DISCORD_TOKEN: ${{ secrets.CI_BOT_TOKEN }}
121+
DISCORD_CLIENT_ID: ${{ secrets.CI_CLIENT_ID }}
122122
run: |
123123
envsubst < .github/config.json > config.json
124124

CONTRIBUTING.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## Setup
2+
3+
See [docs/SETUP.md](./docs/SETUP.md) for a guide on setting up your local bot.
4+
15
## Commands
26

37
We differentiate between the following types of commands:

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ cp config.template.json config.json
6363
$EDITOR config.json
6464
```
6565
> [!TIP]
66-
> Die Datei kann Kommentare und Trailing-Commas (JSONC). Wenn du nicht VSCode verwendest, musst du das ggf. noch einstellen.
66+
> Die Datei kann Kommentare und Trailing-Commas (JSONC). Wenn du nicht VSCode verwendest, musst du das ggf. noch einstellen.
6767
6868
2. Das Template ist für die [Coding-Test-Zentrale](https://discord.gg/ekJA6GA3BJ) vorausgefüllt. Es fehlen noch:
6969
- Um einen Bot zum Testen anzulegen, einfach den Instruktionen im [Discord Developer Portal](https://discord.com/developers/applications) folgen.
7070
- Die Applikation muss als "Bot" gesetzt werden.
7171
- Es müssen beide [Gateway Intents](https://discordjs.guide/popular-topics/intents.html#gateway-intents) eingeschalten werden.
72-
- Ersetze `<CLIENT_ID>` durch die Application-ID
73-
- Ersetze `<BOT_TOKEN>` durch das Bot-Token
72+
- Ersetze `<DISCORD_CLIENT_ID>` durch die Application-ID
73+
- Ersetze `<DISCORD_TOKEN>` durch das Bot-Token
7474
- Um IDs kopieren zu können, den "Developer Mode" in den Discord Einstellungen aktivieren. Mit Rechtsklick kann man dann die IDs kopieren.
7575
3. Das Script starten.
7676

config.template.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
// This file supports comments and trailing commas
33
"auth": {
4-
"clientId": "<CLIENT_ID>",
5-
"token": "<BOT_TOKEN>"
4+
"clientId": "<DISCORD_CLIENT_ID>",
5+
"token": "<DISCORD_TOKEN>"
66
},
77
"sentry": {
88
"dsn": null,

docs/SETUP.md

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Initial Dev Setup
2+
This has to be done once, usually.
3+
4+
## Getting Tokens and Stuff
5+
If you already have your `DISCORD_CLIENT_ID` and `DISCORD_TOKEN`, you can skip these steps and go straight to `Add Bot Config`.
6+
7+
### Create an application here: https://discord.com/developers/applications
8+
9+
![Creating an Application](./images/0-create-application.png)
10+
11+
### Copy the "Application ID". This is your `DISCORD_CLIENT_ID`.
12+
13+
![Example Application Id](./images/1-application-id.png)
14+
15+
### Add a Bot
16+
1. Go to "Bot" on the left side.
17+
2. Click "Add Bot" and confirm.
18+
19+
### Bot Permissions
20+
Set these permissions:
21+
22+
![Needed Bot Permissions](./images/2-permissions.png)
23+
24+
### Create a Bot Token
25+
Click on "Reset Token" and copy the token that is generated. This is your `DISCORD_TOKEN`.
26+
27+
![Creating a Token](./images/3-create-token.png)
28+
29+
## Add Bot Config
30+
31+
Once you have your `DISCORD_CLIENT_ID` and `DISCORD_TOKEN`, you can create a new config and fill in these values:
32+
```sh
33+
cp ./config.template.json ./config.json
34+
$EDITOR config.json
35+
```
36+
37+
The config template is pre-filled with valid values for [Coding-Test-Zentrale](https://discord.gg/ekJA6GA3BJ). If you add new config values, also add them in the config template.
38+
39+
> [!TIP]
40+
> As the config.json is actually a `.jsonc` file, it supports comments and trailing commas. If you use VSCode, you can set the syntax mode to `JSONC`.

docs/images/0-create-application.png

22.3 KB
Loading

docs/images/1-application-id.png

21.1 KB
Loading

docs/images/2-permissions.png

74.5 KB
Loading

docs/images/3-create-token.png

32.3 KB
Loading

0 commit comments

Comments
 (0)