diff --git a/discord_embed/settings.py b/discord_embed/settings.py index 116066c..5fc6708 100644 --- a/discord_embed/settings.py +++ b/discord_embed/settings.py @@ -1,4 +1,5 @@ import os +import pathlib import sys from dotenv import load_dotenv @@ -28,6 +29,9 @@ class Settings: except KeyError: sys.exit("discord-embed: Environment variable 'UPLOAD_FOLDER' is missing!") + # Create upload_folder if it doesn't exist. + pathlib.Path(upload_folder).mkdir(parents=True, exist_ok=True) + # We check if the upload folder ends with a forward slash. If it does, we remove it. if upload_folder.endswith("/"): upload_folder = upload_folder[:-1]