aboutsummaryrefslogtreecommitdiff
path: root/config.py
diff options
context:
space:
mode:
Diffstat (limited to 'config.py')
-rw-r--r--config.py38
1 files changed, 3 insertions, 35 deletions
diff --git a/config.py b/config.py
index 5448110..509ec43 100644
--- a/config.py
+++ b/config.py
@@ -35,7 +35,6 @@ DB_PORT = None
DB_USER = None
DB_PASSWORD = None
-
schema = {
"type": "object",
"properties": {
@@ -47,7 +46,7 @@ schema = {
},
"required": ["token"],
},
- "sqlite": { # TODO - turn SQLITE path and name into global variables
+ "sqlite": {
"type": "object",
"properties": {
"name": {"type": "string", "default": "disarchive"},
@@ -93,7 +92,7 @@ schema = {
}
-# Attempt to load the config file, otherwise create a new template
+# Load config file or alert user if not found
def load_config():
if os.path.exists("/.dockerenv"):
file_path = "/config/config.yaml"
@@ -114,7 +113,7 @@ def load_config():
)
-# Thouroughly validate all of the options in the config.yaml file
+# Validate the config file against the schema
def validate_config(file_contents):
global TOKEN, BOT_COLOR, SQLITE_NAME, DB_NAME, DB_ENGINE, DB_HOST, DB_PORT, DB_USER, DB_PASSWORD
config = yaml.safe_load(file_contents)
@@ -170,34 +169,3 @@ def validate_config(file_contents):
DB_ENGINE = "sqlite"
TOKEN = config["bot_info"]["token"]
-
-
-"""
-Template for embeds
-"""
-
-
-def create_embed(
- title: str = None,
- description: str = None,
- color=None,
- footer=None,
- thumbnail=None,
-):
- embed = discord.Embed(
- title=title,
- description=description,
- color=color if color else BOT_COLOR,
- )
-
- if footer:
- embed.set_footer(text=footer)
- # else:
- # embed.set_footer(
- # text=datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S") + " UTC"
- # )
-
- if thumbnail:
- embed.set_thumbnail(url=thumbnail)
-
- return embed