A Bot for the Private BBC Apprentice & Trainee Discord
This is designed to allow any BBC Trainee & Apprentice (or any other who wishes) to add functionality, test out programming skills or just for fun!
The functionality is such that each command can be its own file and then is loaded.
This project uses:
- Python 3.8+
- discord.py
- Pipenv for package management
Clone this project and then:
- Run
pipenv installto install the currently listed modules. - Go to https://discord.com/developers/applications and create an application
- After creating, the appliication. Proceed to the
Botpage,Add Botand copy the generated token. - Make a copy of the
.env(template), re-name it to.envand paste your generated token where????currently is - Run
main.pyand your application should log in and be assessible. NOTE: You will need to add the bot to a server to interact with it
To trigger a release, a git tag is created. The format for this is the MAJOR.MINOR.PATCH format.
The GitHub action triggers two functions:
- Creates a Release
- Triggers the Deployment to the remote server.
- The servers uses PM2 to create a daemon which is stopped and started between a
git pulland apipenv install(incase of a change in Python modules)
- The servers uses PM2 to create a daemon which is stopped and started between a
This project makes usage of GitHub actions to automate the deployment.
You can duplicate this functionality by adding the following as GitHub secrets on your cloned repo (in brackets is the name of the SECRET):
- Host IP of remote server (HOST)
- Private SSH Key associated with Public-Private Key pair (SSHKEY)
- Password optional (PASSWORD)
- Username for Remote Server (USER)
Note: The name that each secret is stored under is important as they are directly reference in the .github/workflows YAML file.
Contribute away!
- Fork the repo on GitHub
- Clone the project to your own machine
- Commit changes to your own branch
- Push your work back up to your fork
- Submit a Pull request so that we can review your changes
NOTE: Be sure to merge the latest from "upstream" before making a pull request!
Most code should be submitted in your own "Cog". Refer to the modules/test_cog.py for the basic example.
Each cog must contain a:
- Setup method
- Class that extends
command.Cogs
This project is licensed under MIT. See LICENSE for the full text.