From a8078757faa00d5621c6e0fdda8708ea22958f81 Mon Sep 17 00:00:00 2001 From: phxntxm Date: Sat, 24 Sep 2016 00:37:48 -0500 Subject: [PATCH] Ensured that the paths needed to create images exists --- cogs/utils/images.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cogs/utils/images.py b/cogs/utils/images.py index 34cb884..3b97d20 100644 --- a/cogs/utils/images.py +++ b/cogs/utils/images.py @@ -21,6 +21,10 @@ async def create_banner(member, image_title, data): member -> The user to display stats about image_title -> The title that will displayed before the stats data -> A dictionary that will be displayed, in the format 'Key: Value' like normal dictionaries""" + # First ensure the paths we need are created + os.makedirs(base_path, exist_ok=True) + os.makedirs(tmp_path, exist_ok=True) + # Open up the avatar, save it as a temporary file avatar_url = member.avatar_url avatar_path = "{}/avatar_{}_{}.jpg".format(tmp_path, member.id, int(datetime.datetime.utcnow().timestamp()))