Ensured that the paths needed to create images exists
This commit is contained in:
parent
2284049af0
commit
a8078757fa
1 changed files with 4 additions and 0 deletions
|
@ -21,6 +21,10 @@ async def create_banner(member, image_title, data):
|
||||||
member -> The user to display stats about
|
member -> The user to display stats about
|
||||||
image_title -> The title that will displayed before the stats
|
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"""
|
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
|
# Open up the avatar, save it as a temporary file
|
||||||
avatar_url = member.avatar_url
|
avatar_url = member.avatar_url
|
||||||
avatar_path = "{}/avatar_{}_{}.jpg".format(tmp_path, member.id, int(datetime.datetime.utcnow().timestamp()))
|
avatar_path = "{}/avatar_{}_{}.jpg".format(tmp_path, member.id, int(datetime.datetime.utcnow().timestamp()))
|
||||||
|
|
Loading…
Reference in a new issue