@@ -23,6 +23,10 @@ DISCORD_APPLICATION_ID: Available in general panel of your discord bot.
23
23
DISCORD_PUBLIC_KEY: Available in general panel of your discord bot.
24
24
```
25
25
26
+ Now, generate a set of RSA keys 2048 bit in size.
27
+
28
+ We will use them as ` BOT_PRIVATE_KEY ` and ` BOT_PUBLIC_KEY `
29
+
26
30
Please set Following permissions for your bot:
27
31
28
32
- Navigate to OAuth2 > URL Generator
@@ -54,9 +58,17 @@ This will register all the commands to your discord bot.
54
58
55
59
Now let's link our local development server to our bot.
56
60
57
- - After all the commands are installed we need to save few secrets in wrangler cli.
58
- - run command ` wrangler secret put DISCORD_TOKEN ` and then enter the value of your token.
59
- - run command ` wrangler secret put DISCORD_PUBLIC_KEY ` and enter the public key.
61
+ run the command ` npx wrangler publish `
62
+
63
+ - After all the commands are installed we need to save few secrets to do that go to:
64
+
65
+ - Go to Your cloudflare ` dashboard > workers > discord-slash-commands > settings > variables > edit Variables `
66
+ - Now add following variables to your environment:
67
+ - ` BOT_PRIVATE_KEY `
68
+ - ` DISCORD_GUILD_ID `
69
+ - ` DISCORD_PUBLIC_KEY `
70
+ - ` DISCORD_TOKEN `
71
+
60
72
- Now, start the local server with the command ` npm start `
61
73
- Once the wrangler starts make sure it is running on port ` 8787 `
62
74
- Once the server starts on desired port open another terminal and type in the command ` npm run ngrok `
@@ -70,4 +82,22 @@ To verify if your bot is working:
70
82
- Go to the server where your bot was invited
71
83
- run a /hello command and the bot should reply with ` Hello <Your_username> `
72
84
85
+ Now add the public key in ` rds-backend `
86
+
87
+ - Go to ` local.js ` in config
88
+ - create following there
89
+
90
+ ```
91
+ botToken:{
92
+ botPublicKey:<Public key generated in the format similar to development.js>
93
+ }
94
+ ```
95
+
96
+ - Start the rds backend
97
+ - open a new terminal in backend and run the following command ` npx ngrok http <backend-port> `
98
+
99
+ - come to ` constants.js ` in discord-slash-commands
100
+ - go to ` src/constants/urls.ts `
101
+ - change the ` RDS_BASE_DEVELOPMENT_API_URL ` to the ` ngrok https ` url generated for rds backend
102
+
73
103
Now you are ready to contribute to the Repository.
0 commit comments