1. Initial Setup - Nadro-J/InternalGov-2.0 GitHub Wiki
Discord Application API key
-
First, you'll need to create a new application on the Discord Developer Portal. If you don't already have an account, you'll need to sign up for one.
-
Once you're logged in to the Discord Developer Portal, click on the "New Application" button in the top right corner. Give your application a name and click "Create".
-
Next, click on the "Bot" section in the left-hand menu and then click "Add Bot". Give your bot a username and profile picture, and click "Save Changes".
-
Enable Server Members Intent (This is used when MIN_PARTICIPATION in the .env config is set to a number > 0. It is used to fetch the total amount of users in a particular role to calculate the participation)
-
Under the "Token" section, click the "Copy" button to copy the API key. This key is what you'll use to authenticate your bot and allow it to interact with the Discord API.
-
Under Oauth2 -> URL Generator select
bot
and then select:- Manage Roles
- Create Public Threads
- Send Messages in Threads
- Manage Messages
- Manage Threads
- Mention Everyone
NOTE: Manage Roles
is only needed initially to create the [SYMBOL]-GOV role to notify members to vote. You can either create the role yourself or remove Manage Roles
permission once the role is created to limit any attack surface. The created role has no inherent permission and is only used for tagging.
- Be sure to keep your API key secret! Don't share it with anyone or include it in any public code repositories.
How to get Server ID & Forum ID
-
Open Discord and click on the gear icon next to your username in the bottom left corner of your screen.
-
Under App Settings, click Advanced and enable Developer Mode
-
Right-click on your server and copy Server ID. The same step is repeated for the forum channel.