1
0
Fork 0
mirror of https://github.com/uhIgnacio/EmoteManager.git synced 2024-08-15 02:23:13 +00:00

strip leading directory paths from archive members

This commit is contained in:
bmintz 2019-08-04 11:34:11 +00:00
parent 4828a4ff52
commit 165faa631f

View file

@ -197,7 +197,7 @@ class Emotes(commands.Cog):
limit = 50_000_000 # prevent someone from trying to make a giant compressed file
async for name, img, error in utils.archive.extract_async(io.BytesIO(archive), size_limit=limit):
if error is None:
name = self.format_emote_filename(name)
name = self.format_emote_filename(posixpath.basename(name))
async with context.typing():
await context.send(await self.add_safe_bytes(context.guild, name, context.author.id, img))
continue