nohr-ai / discord-ta-bot

MIT License
0 stars 0 forks source link

Discord TA-bot-template

A simple template for hosting discord servers for courses at uni, written in python.

Features

Out of the box, this template offers/requires:

Requires:

Setup

All python dependencies can be found in requirements.txt, alternatively, you can install them from the poetry.lock file.

python -m pip install -r requirements.txt / poetry install

MongoDB

Local

To setup a local instance of MonboDB you can follow MongoDB.inc's manual here for Ubuntu. They have guides for other environments such as Red Hat, Debian,SUSE, macOS, and Windows.

As of January 2024 you can do the following for Ubuntu 22.04 LTS (jammy):

  1. sudo apt install gnupg curl
  2. curl -fsSL https://pgp.mongodb.com/server-7.0.asc | sudo gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg --dearmor
  3. echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list
  4. sudo apt update
  5. sudo apt-get install -y mongodb-org

For adjusting system limitations, see MongoDB.inc's guide, link above.

Atlas

To setup a remotely hosted free DB instance, you can follow the guide here.

Run


systemd

  1. sudo systemctl start mongod
    1. If this fail, try: sudo systemctl daemon-reload and retry the first
  2. sudo systemctl status mongod to verify it's running, optinally enable it to start on reboot: sudo systemctl enable mongod

Note: If you have an older system you might miss cpu-extensions that MongoDB uses, if you cannot start the server (core dump) you can try community/older versions of mongodb.

Configuration

The bot requires that you have access to Discord developer portal. For a tutorial, have a look here.

In the repository you will find a file env_example with some config values. The mandatory values are:

Optional values: