college-bot-v1/config.example.py

86 lines
3.5 KiB
Python
Raw Normal View History

2023-02-22 14:42:31 +00:00
# Configuration for LCC-Bot resides here.
# This file is not tracked by git, so you can safely change it without worrying about it being overwritten or
# accidentally committing your changes.
# Please note that removing any of the variables here may cause errors - if you remove a variable, you should
# test the bot to make sure it still works. If you removed a variable that's required, you will get an ImportError.
#
# Note that sometimes new config options are added down the line - you should occasionally check
# https://github.com/EEKIM10/LCC-bot/blob/master/config.example.py to see if there are any changes or new options.
2023-01-14 23:14:57 +00:00
import datetime
import os
2023-02-22 14:42:31 +00:00
import discord
2023-01-14 23:14:57 +00:00
2023-02-22 14:42:31 +00:00
# The IDs of guilds the bot should be in; used to determine where to make slash commands
2023-02-22 15:17:53 +00:00
# If you put multiple IDs in here, the first one should be your "primary" server.
2023-01-14 23:14:57 +00:00
guilds = [994710566612500550]
2023-02-22 14:42:31 +00:00
# Email & email password for the email verification system
2023-01-14 23:14:57 +00:00
email = None
email_password = "app-specific email password"
2023-02-22 14:42:31 +00:00
# Reminder timings for the assignments' system. This doesn't really need changing.
2023-01-14 23:14:57 +00:00
reminders = {
"1 week": 806400,
"2 days": 86400 * 2,
"1 day": 86400,
"6pm": datetime.time(18, 0, 0, 0),
"3 hours": 3600 * 3,
}
2023-02-22 14:42:31 +00:00
# Toggles whether the bot will show the lupupa warning status on thursdays.
2023-01-14 23:14:57 +00:00
lupupa_warning = True
2023-02-22 14:42:31 +00:00
# Here are variables used by the web server for authentication.
# If not all of these are provided, web-auth is disabled.
# This also means that web-based verification is also disabled.
# Incorrect credentials will cause errors, indirectly disabling the web functionality.
# Set all of these to `none` if you don't want to use the web functionality.
OAUTH_ID = None # The user ID of your bot. Must be a string.
OAUTH_SECRET = "my_secret" # The oauth secret.
OAUTH_REDIRECT_URI = "http://127.0.0.1:3762/auth" # The full redirect URI registered on your oauth page.
# Here you can change where the web server points.
# You should not change this as you should only permit access to the web server via web proxy.
HTTP_HOST = "127.0.0.1"
HTTP_PORT = 3762
# You can also just fully turn the web server off
2023-02-22 15:17:53 +00:00
WEB_SERVER = True # change this to False to disable it
# Or change uvicorn settings (see: https://www.uvicorn.org/settings/)
# Note that passing `host` or `port` will raise an error, as those are configured above.
UVICORN_CONFIG = {
"log_level": "error",
"access_log": False,
"lifespan": "off"
}
2023-02-22 14:42:31 +00:00
# Only change this if you want to test changes to the bot without sending too much traffic to discord.
# Connect modes:
# * 0: Operate as normal
# * 1: Exit as soon as the bot is ready
# * 2: Exit before making the websocket connection to discord
CONNECT_MODE = 0
2023-04-02 16:36:33 +01:00
# The channel ID of the channel to send the spam message to.
# "Spam" is usually just automated, non-interactive messages.
# If this is set to None, the bot will not send spam messages.
SPAM_CHANNEL = None
2023-02-22 14:42:31 +00:00
# Toggles dev mode based on the environment variable `DEV`. You can set this to anything here, as long as it
# can evaluate to a boolean.
2023-01-14 23:14:57 +00:00
dev = bool(int(os.getenv("DEV", "0")))
if dev is False:
2023-02-22 14:42:31 +00:00
# This is the token that will be used if dev mode is disabled.
2023-01-14 23:14:57 +00:00
token = "PROD_TOKEN"
else:
2023-02-22 14:42:31 +00:00
# This is the token that will be used for development mode. You should specify this if you have a separate test bot
# to avoid creating duplicate slash commands or exceeding rate limits.
2023-01-14 23:14:57 +00:00
token = "DEV_TOKEN"
2023-02-22 14:42:31 +00:00
# You can also set intents here if you want to disable some of them. By default, the bot will enable all intents.
intents = discord.Intents.all()