MSc Discord Bot
A discord bot aiming to help us with tasks like notifying, providing info, sending us cat pics (pending), etc.
Current Services
- Notifying in the #general chat when a new announcement is posted in the DSIT page
- Notifying in the #general chat when a new announcement, concerning the MSc programs, is posted in the UoA-DIT page (idea by karabasisilias92)
- Presenting the last x announcements using the command
!announcements x
I would be more than happy to send me ideas, issues and PRs
Setting Up
Creating a development Discord Bot
- First create a discord server you will use to test the bot (name does not matter)
- Go to https://discord.com/developers/applications and press
New Application
(the name does not matter) - From the left go to Bot > Add Bot > Yes
- Next to the icon there is a Token. When connecting to the bot this token will be used (more later).
- From the left go to OAuth2
- On scopes select
Bot
- On bot permissions select
Administrator
- Copy the link between scopes and permission and paste it in a browser. The bot should now join your development server.
From this point you can install the python environment locally (steps 1, 2) or use Docker (step 3).
- Python Environment
- The bot is developed with Python3.8 so make sure you have it installed in your system
- The package manager I used was poetry.
Follow the installation steps of your respective OS.
(Although not suggested, you can avoid using poetry and create an environment using
conda
orvenv
.) - If you did not install poetry there is a
requirements.txt
file you can use to install the dependencies
- Cloning and Running
git clone
andcd
in the repo- If you installed poetry run
poetry install
- (Not tested) If you did not install poetry, install the dependencies using
requirements.txt
(CARE: python version >=3.8) - Run
setup.py
(next to thisREADME.md
) in order to initialize the Token and the#general_chat_id
* - From the root directory of the project run
poetry run python3 main.py
- To test if the bot is running got to your dev server and type in any chat
!announcements
expecting the last 5 announcements of DSIT to appear
- (Alternatively) Run the bot on a development docker container
- Run
setup.py
(next to thisREADME.md
) in order to initialize the Token and the#general_chat_id
* - Build the docker image
docker build . -t <tag>
- Run the container
docker run -v /path/to/dsit_bot/dsit_bot:/app/dsit_bot <tag>
- Run
* For the notification of a new announcement the bot requires a text channel ID that will print the announcement. For now you should follow the steps below to get it:
- Go to Discord User Settings > Appearance > Enable Developer Mode
- Go to you dev server > right click on #general > Copy Id
Feel free to tell me if there are any mistakes, needed clarifications or in general if you are having trouble setting it up.