To facilitate efficient development, it will be helpful to run your own bot on our test server. We have test versions of Notion and a MongoDB instance. To get setup, please follow these guidelines:
- Visit the Discord Developer Portal
- Sign in with your Discord credentials
- Create a new application, call it whatever you want
- On the left, select "Bot" and create a bot user
- Switch on "Presence Intent" and "Server Members Intent"
- Save your changes
- On the left, select "OAuth2"
- Under "Scopes", select "bot"
- Permissions. Enable only these permissions:
- Manage Server
- Manage Roles
- Manage Channels
- Kick Members
- Ban Members
- Manage Emojis
- Manage Webhooks
- View Channels
- All of the permissions under "Text Permissions"
- No permissions under "Voice Permissions"
- Select and copy the generated URL under "Scopes." Make sure the value of permissions in the URL reads 4027055222
- Send the URL via Discord DM to nonsense to have it added to the test Discord server
- Create a new feature branch from the dev branch
- Copy the .env file and name it whatever you want; add it to your local .gitignore
- Request the test Notion token and MongoDB URI from one of the repo
maintainers, copy your bot's token (found under the bot tab in the
developer's portal) and replace the relevant values in your copied .env
file, making sure to update the file name where it is required in
app.js
npm install
- Run your bot and test your connections
Work on your features/assignments. Tests should be written for new features that are added. We are using Jest as the test library, so please familiarize yourself with Jest if you are not already familiar with it. If you need help with writing tests, please ask, as we have a couple devs on board who have experience in this area.
When you feel the feature is ready to be battle tested, lint and test your code and run it through Prettier prior to pushing it. Submitting a PR will trigger this workflow anyway. However, the less we have to do to fix merge conflicts and failed workflows, the better.
Once the branch is ready to be merged, push it to the repo and create a PR to the dev branch. From this point, it will follow the details set out in WORKFLOW.md.