Browse Source

Merge branch 'development'

pull/57/head
Roxie Gibson 5 years ago
parent
commit
6e8b4bcba3
No known key found for this signature in database
2 changed files with 3 additions and 1 deletions
  1. +1
    -1
      roxbot/cogs/util.py
  2. +2
    -0
      roxbot/http.py

+ 1
- 1
roxbot/cogs/util.py View File

@@ -57,7 +57,7 @@ class Util(commands.Cog):
url = user.avatar_url_as(static_format="png")
filename = re.sub(' |\?|\.|!|/|\\|:|\"|\[|\]|;|=|\||\*|,', '', user.name+str(user.id))

if ".gif" in url:
if ".gif" in str(url):
avaimg = '{0}.gif'.format(filename)
else:
avaimg = '{0}.png'.format(filename)

+ 2
- 0
roxbot/http.py View File

@@ -83,6 +83,8 @@ async def download_file(url, filename=None):
filename: str
Handy if no filename given
"""
if not isinstance(url, str):
url = str(url)
if filename is None:
filename = url.split("/")[-1].split("?")[0]
async with aiohttp.ClientSession() as session:

Loading…
Cancel
Save