|
| 1 | +# Contributing to Real Dev Squad Discord Bot |
| 2 | + |
| 3 | +- [Getting Started](#getting-started) |
| 4 | +- [Setting Up Local Development](#setting-up-local-development) |
| 5 | + |
| 6 | +## Getting Started |
| 7 | + |
| 8 | +To work on this project please create an account on Cloudflare and Discord. |
| 9 | +Also, create a personal discord server. |
| 10 | +Copy the guild id of your server and save it in a .env file as `DISCORD_GUILD_ID` |
| 11 | + |
| 12 | +To get the server ID for the first parameter, open Discord, go to Settings > Advanced and enable developer mode. |
| 13 | +Then, right-click on the server title and select "Copy ID" to get the guild ID. |
| 14 | + |
| 15 | +- Visit [Discord Developer Portal](https://discord.com/developers/applications) |
| 16 | +- Click on new application. |
| 17 | + |
| 18 | +Gather the following details from the Developer portal and save it in a .env file. |
| 19 | + |
| 20 | +``` |
| 21 | +DISCORD_TOKEN: Available in bot panel of your discord bot after clicking reset token button. |
| 22 | +DISCORD_APPLICATION_ID: Available in general panel of your discord bot. |
| 23 | +DISCORD_PUBLIC_KEY: Available in general panel of your discord bot. |
| 24 | +``` |
| 25 | + |
| 26 | +Please set Following permissions for your bot: |
| 27 | + |
| 28 | +- Navigate to OAuth2 > URL Generator |
| 29 | + - In scopes select `bot` and `applications.commands` |
| 30 | + - In Bot Permissions select |
| 31 | + - Manage Roles |
| 32 | + - Change Nickname |
| 33 | + - Manage Nicknames |
| 34 | + - Send messages |
| 35 | + - Create public threads |
| 36 | + - Create private threads |
| 37 | + - Send message in threads |
| 38 | + - Embed links |
| 39 | + - Mention Everyone |
| 40 | + - Use slash commands |
| 41 | + |
| 42 | +After providing all the permissions you will get an url at the bottom of the page use that to invite the bot to your server. |
| 43 | + |
| 44 | +Open the Url you get and invite the bot to your test server. |
| 45 | + |
| 46 | +## Setting Up Local Development |
| 47 | + |
| 48 | +- Clone the Repository to your machine |
| 49 | +- Now, get the .env file created above in the project folder |
| 50 | +- run `npm install` |
| 51 | +- Now, run the command `npm run register` |
| 52 | + |
| 53 | +This will register all the commands to your discord bot. |
| 54 | + |
| 55 | +Now let's link our local development server to our bot. |
| 56 | + |
| 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. |
| 60 | +- Now, start the local server with the command `npm start` |
| 61 | +- Once the wrangler starts make sure it is running on port `8787` |
| 62 | +- Once the server starts on desired port open another terminal and type in the command `npm run ngrok` |
| 63 | +- The above command will give you a `https` link copy that. |
| 64 | +- Now, go to [Discord Developer Portal](https://discord.com/developers/applications) and select your bot |
| 65 | + - In general information panel you will find a space for `INTERACTIONS ENDPOINT URL` |
| 66 | + - Enter the copied link here and hit save. |
| 67 | + |
| 68 | +To verify if your bot is working: |
| 69 | + |
| 70 | +- Go to the server where your bot was invited |
| 71 | +- run a /hello command and the bot should reply with `Hello <Your_username>` |
| 72 | + |
| 73 | +Now you are ready to contribute to the Repository. |
0 commit comments