mirror of
https://github.com/uhIgnacio/EmoteManager.git
synced 2024-08-15 02:23:13 +00:00
add webp to an error message
This commit is contained in:
parent
0173884617
commit
7b2f963dd7
1 changed files with 2 additions and 2 deletions
|
@ -334,7 +334,7 @@ class Emotes(commands.Cog):
|
||||||
try:
|
try:
|
||||||
emote = await self.create_emote_from_bytes(context.guild, name, author_id, image_data, reason=reason)
|
emote = await self.create_emote_from_bytes(context.guild, name, author_id, image_data, reason=reason)
|
||||||
except discord.InvalidArgument:
|
except discord.InvalidArgument:
|
||||||
return discord.utils.escape_mentions(f'{name}: The file supplied was not a valid GIF, PNG, or JPEG file.')
|
return discord.utils.escape_mentions(f'{name}: The file supplied was not a valid GIF, PNG, JPEG, or WEBP file.')
|
||||||
except discord.HTTPException as ex:
|
except discord.HTTPException as ex:
|
||||||
return discord.utils.escape_mentions(
|
return discord.utils.escape_mentions(
|
||||||
f'{name}: An error occurred while creating the the emote:\n'
|
f'{name}: An error occurred while creating the the emote:\n'
|
||||||
|
@ -342,7 +342,7 @@ class Emotes(commands.Cog):
|
||||||
s = f'Emote {emote} successfully created'
|
s = f'Emote {emote} successfully created'
|
||||||
return s + ' as a GIF.' if converted else s + '.'
|
return s + ' as a GIF.' if converted else s + '.'
|
||||||
|
|
||||||
async def fetch(self, url, valid_mimetypes=None, *, validate_headers=True):
|
async def fetch(self, url, valid_mimetypes=IMAGE_MIMETYPES, *, validate_headers=True):
|
||||||
valid_mimetypes = valid_mimetypes or self.IMAGE_MIMETYPES
|
valid_mimetypes = valid_mimetypes or self.IMAGE_MIMETYPES
|
||||||
def validate_headers(response):
|
def validate_headers(response):
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
|
|
Loading…
Reference in a new issue