Skip to content

Caleb-Wishart/Squad-Bot

Repository files navigation

UQCSC-Bot V2.0

Discord

Python Version 3.10 Code style: black

PRs Welcome Works on my machine

A somewhat complete discord bot template with example cogs that uses a Postgresql server as a storage mechanism.

Primary used for the UQCS Courses Discord Server.

Docker
Docker files are included for easy deployment.

Contributing

This repository uses the Black code style to format python files.
The use of the flake8 and isort is highly prefered.

See requirements-dev.txt.

Main Features

  • Main bot
    • Configure with environment variables
    • File logging
    • PSQL Database connection
    • Cogs manager / default commands
    • Push based Heartbeat
  • Cogs
    • Administrative
      • manage cogs
      • clear messages
      • sync app commands
    • General
      • Fortune
      • Ping
      • Decide
    • Statistics
      • Determine how many times a particular message has been sent to a channel
      • Role based rewards
      • Leaderboard scoring system
      • Configurable by discord message
    • Reminders
      • Create / Delete repeating or once off reminders
    • Courses
      • Enrol / Drop courses (channels)
      • Auto delete empty channels
      • database storage

Configuration

The bot has a number of environment variables that can be used to configure the environment.

Discord.py

BOT_TOKEN

Required.

The Discord BOT Token generated from discord.com/developers/applications

BOT_PREFIX

Optional.

The prefix to use for the discord bot text commands

COGS

Optional.

Comma separated list of cogs to load on startup. See Cogs for a list of available cogs.

Logging

LOGGING_ENABLED

Optional. Default: True

Enable logging to a file

LOGFILE_LOCATION

Optional. Default: $(Current Working Directory)/logs

Specify log file location. **!!!: ** Make sure this directory exists

Postgres Settings

https://hub.docker.com/_/Postgres If not using standalone postgres

POSTGRES_PASSWORD

Required.

Password for the Postgres Database

POSTGRES_USER

Optional.

Set a user to be created in the Database.

POSTGRES_DB

Optional.

Set a database name.

PGPORT

Optional.

Specify which port the database should use. If not using standard postgres port, also set POSTGRES_PORT

Misc.

DB_ENABLED

Optional. Default: True

Set this to False if you do not wish to configure a PSQL database

POSTGRES_HOST

Required (if using database functions).

IP or hostname for the postgres database

POSTGRES_PORT

Optional.

Specify which port the database should use. If not using standard postgres port, also set PGPORT.

DEBUG

Optional. (Boolean values only)

Enable debug mode.

Heartbeat

HEARTBEAT_DESTINATION

Optional.

The destination URL where the heartbeat signal should be sent.

HEARTBEAT_INTERVAL

Optional. Default: 60

The interval in seconds between each heartbeat signal.

HEARTBEAT_METHOD

Optional. Default: GET

The HTTP method to use for sending the heartbeat signal (e.g., POST, GET).

About

Discord Bot for 'UQ Computer Science Courses' -- https://discord.gg/JpjaB2FNdW

Topics

Resources

License

Stars

Watchers

Forks