In application page click OAuth -> URL Generator and check the box for bot
Copy the link generated and paste into web browser to invite bot to your discord server
Go to bot page in discord, and reset your token (make sure to copy and paste this somewhere
or you will have to reset token again)
Setting up your environment
Use virtualenv to setup a python 3.12 environment or if you want you can use native python 3.12 from system
Run pip install -r requirements.txt from this directory to install dependencies
Setting up Python Secrets and Bot Config
Create a .env file in this directory and set the following variables
DISCORD_BOT_TOKEN=<YOUR TOKEN FROM BEFORE HERE>
MOD_AUDIT_CHANNEL_ID=<Moderation Audit Channel ID here>
ROLE_MESSAGE_ID=<Message to react to for role assignment here>
MODERATOR_ROLES=<roles here separated by `,`for example `a,b,c`>
LOGURU_LEVEL=<LOG LEVEL>
Source the env file you created and run the app.py
As a discord server grows, it becomes more important to moderate the community for bad users. The moderation of the community should also leave a paper trail in the form of logs in a channel to provide context to other moderations on what happened. A bot command suite should be built to enable this.
The bot command should have:
mod category which contains commands like kick, ban, timeout which does what name is at face value
all commands should have descriptive helper text
all mod commands should log to a new channel that is configurable, the event that happened i.e. Kicked <user> because <reason>
mod commands in the channel should be an embed discord message with nice formatting to allow for ease of parsing in the future
As Jainy bot grows in features and complexity, one question that comes up is how long as Jainy been up and when was Jainy deployed (i.e. started on the server)? A bot command to show the uptime a reasonable format
The bot should have:
Command to call uptime
Display uptime in readable format
Description in help command to describe what it does
As the project grows, manual creation and deployment of Jainy bot can become tedious. The request is to provide an automated solution for creating the Jainy bot docker image and publishing it to dockerhub and eventually re-deploying the bot on Digital Ocean (DO).
The request should have:
Github Actions setup to build docker image whenever PR happens in develop or master
Github Actions should push docker image if merge happens in develop or master
Github Actions should attempt to run the docker build job when PR is filed