Contribution Guidelines
November 19, 2022 ยท View on GitHub
To facilitate efficient development, it will be helpful to run your own bot on your test server. To get setup, please follow these guidelines:
Create your own bot to use in your local dev environment
- 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" and navigate to "URL Generator"
- Under "Scopes", select "bot" and "application.commands"
- Permissions: BOT_PERMISSIONS.md
- Select and copy the generated URL under "Scopes."
- Use the url to add the bot to your test server.
Set up local environment
- Clone the repo:
git clone https://github.com/governatorXYZ/governator-bot.git - Create a new feature branch from the dev branch ( e.g.
git checkout -b feature/my-new-feature). - Copy the
.env.templatefile and name it.env. If you are unsure how to set the variables, get in touch with us. yarn startwill run the prestart script to get everything installed and running.- Run your bot and test your connections.
- Whenever you're ready for a pull request, open a pr with
devbranch.
IMPORTANT: The bot listens to events emitted from the governator-api. To develop features for the bot you probably want to run it locally. Check out the governator-api repo to get started.
Develop!
Work on your features. 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 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 develop branch. From this point, it will follow the details set out in WORKFLOW.md.