diff --git a/main.py b/main.py index 702529a..60eb928 100755 --- a/main.py +++ b/main.py @@ -1,6 +1,7 @@ #!/bin/env python3 from typing import Literal, Optional from yaml import safe_load +import os import discord from discord.ext import commands @@ -18,8 +19,12 @@ class Bot(commands.Bot): self.add_view(RoleSelectView()) return await super().setup_hook() - with open('config.yaml', 'r') as file: - config = safe_load(file) + for loc in os.curdir, "/etc/salzarbeiter", os.environ.get("CFG_FILE"): + try: + with open(os.path.join(loc, "config.yaml"), "r") as file: + config = safe_load(file) + except: + pass # Bot client = Bot()