Skip to content

Latest commit

 

History

History
36 lines (28 loc) · 1.35 KB

File metadata and controls

36 lines (28 loc) · 1.35 KB

cloud-bot

A bot written in Discord.py, using Cogs and slash commands.

Quick Links

Structure

All bot files are in /src

The Main.py file loads "cogs" from the src/cogs directory. Cogs can be thought of as "individual commands", and provide a nice easy way of keeping code clean.

Environment

The bot uses a .env file to grab things like the discord token. The .env file should be in the same directory as the main.py The required environment variables are:

# Discord related things
PREFIX=> # The bot's prefix for non-slash commands. 
TOKEN=YOUR_DISCORD_BOT_TOKEN_HERE # The discord token from https://discord.com/developers/applications

# Logging related things
LOG_LEVEL=20 # The bot's logging level (https://www.geeksforgeeks.org/logging-in-python/)
STREAM_LOGS=True # Allows us to stream logs to STDOUT. Good for visibility.

Running the bot

Without Docker
  1. Make sure the above .env file exists, or your environment contains the variables listed above.
  2. python /src/__main__.py
With Docker
  • To run: docker compose up -d
  • To see logs: docker logs cloud-bot or docker logs -f cloud_bot
  • To rebuild with changes: docker compose up -d --build cloud_bot