Procházet zdrojové kódy

changed output of avatar so that the image is now a png and not a webp

tags/v1.7.0
Roxie Gibson před 6 roky
rodič
revize
defdd35b53
2 změnil soubory, kde provedl 4 přidání a 3 odebrání
  1. +1
    -0
      README.md
  2. +3
    -3
      Roxbot/cogs/util.py

+ 1
- 0
README.md Zobrazit soubor

###### New Features ###### New Features
- NSFW commands now have the same system of preventing dupe outputs - NSFW commands now have the same system of preventing dupe outputs
###### Minor Changes ###### Minor Changes
- `avatar` now outputs a png if the image is static.
- Moved NSFW commands to use aiohttp instead of requests which hopefully will wield quicker response times. - Moved NSFW commands to use aiohttp instead of requests which hopefully will wield quicker response times.
- Minor refactoring in places, which involves some directory movement. - Minor refactoring in places, which involves some directory movement.
###### Bug Fixes ###### Bug Fixes

+ 3
- 3
Roxbot/cogs/util.py Zobrazit soubor

if not user: if not user:
user = ctx.author user = ctx.author


url = user.avatar_url
url = user.avatar_url_as(static_format="png")
if url.split(".")[-1] == "gif": if url.split(".")[-1] == "gif":
avaimg = 'avaimg.gif'
avaimg = '{0.name}.gif'.format(user)
else: else:
avaimg = 'avaimg.webp'
avaimg = '{0.name}.png'.format(user)


async with aiohttp.ClientSession() as session: async with aiohttp.ClientSession() as session:
async with session.get(url) as img: async with session.get(url) as img:

Načítá se…
Zrušit
Uložit