-
Create a server for testing
Use this server template to create a new server https://discord.new/hQVpKQKVnpSQ
-
Create a bot account for testing
- Log in to https://discordapp.com/developers/applications
- Click "New Application" and give it a name
- Click on "Bot" in the list on the left
- Click "Add Bot" and then "Yes, do it!"
- Turn on both the Presence Intent and the Server Members Intent under Privileged Gateway Intents
- Click on "OAuth2" in the list on the left
- Tick "bot" in scopes
- Tick "Administrator" in bot permissions
- Go to the generated link in scopes to add the bot to your test server
-
Set up config file
- You will need to update
botConfiginhelm/citsbot/values.local.yamlwith values from your own test server. Please try avoid committing your changes to this file or revert them before you submit your pull request. - To get IDs go to your discord settings and enable developer mode. The toggle can be found at the bottom of the "Appearance" section under Advanced.
- You can now right click on channels, users, roles, etc. to copy their ID which you can put in your local botConfig
- You will need to update
-
Set up environment variables
- Create a new file called
.envin the root directory (next to package.json) - Add the following to it
DISCORD_TOKEN=<your-discord-bot-token-here>where<your-discord-bot-token-here>is your discord bot token that you can find under the Bot section of the discord developer portal. Do not share this value with anyone. - You can also provide
IMGUR_CLIENT_IDif you would like the anime detector module to backup images to imgur before it removes them. You can follow the instructions here to create the required credentials.
- Create a new file called
- Run
yarnto install dependencies for your IDE - Install docker and kind.
- Install helm by following https://helm.sh/docs/intro/install/
- Start a local kubernetes cluster by running
kind create cluster --name <cluster-name-here>where<cluster-name-here>is any string (e.g.local)
- Run
yarn test
- Make sure you have set up a server, bot account, and config by following the steps in the sections above
- Use the provided scripts to manage the bot. Due to the nature of Kubernetes, the bot will continue running unless you explicitly shut it down with the provided stop script.
| Script | Description |
|---|---|
./local-reset.sh |
Helper to easily restart the bot with your latest changes |
./local-build.sh |
Builds the bot using docker |
./local-start.sh |
Installs the bot's helm chart |
./local-stop.sh |
Uninstalls the bot's helm chart |
./local-tail.sh |
View the bot's logs |