mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-20 02:26:32 +01:00
Make uploader more informative
This commit is contained in:
parent
4df0564b61
commit
665664023e
1 changed files with 4 additions and 4 deletions
|
@ -998,7 +998,7 @@ class OtherCog(commands.Cog):
|
||||||
await ctx.edit(embed=embed)
|
await ctx.edit(embed=embed)
|
||||||
for file in tempdir.glob("%s-*" % ctx.user.id):
|
for file in tempdir.glob("%s-*" % ctx.user.id):
|
||||||
try:
|
try:
|
||||||
bak = file.with_suffix(file.suffix + ".bak")
|
bak = file.with_name(file.name + "-" + os.urandom(4).hex())
|
||||||
shutil.copy(str(file), str(bak))
|
shutil.copy(str(file), str(bak))
|
||||||
file.unlink()
|
file.unlink()
|
||||||
await self.bot.loop.run_in_executor(
|
await self.bot.loop.run_in_executor(
|
||||||
|
@ -1058,7 +1058,6 @@ class OtherCog(commands.Cog):
|
||||||
units[0],
|
units[0],
|
||||||
MAX_SIZE_MB,
|
MAX_SIZE_MB,
|
||||||
)
|
)
|
||||||
embed.set_footer(text="Warning: forced compatibility, download may be too large.")
|
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
files.append(discord.File(file, file.name))
|
files.append(discord.File(file, file.name))
|
||||||
|
@ -1071,8 +1070,9 @@ class OtherCog(commands.Cog):
|
||||||
return await ctx.edit(embed=embed)
|
return await ctx.edit(embed=embed)
|
||||||
else:
|
else:
|
||||||
_desc = embed.description
|
_desc = embed.description
|
||||||
embed.description += f"Uploading {len(files)} file(s)..."
|
embed.description += f"Uploading {len(files)} file(s):\n%s" % (
|
||||||
embed.set_footer(text="Warning: forced compatibility, download may be too large.")
|
"\n".join('* `%s`' % f.filename for f in files)
|
||||||
|
)
|
||||||
await ctx.edit(embed=embed)
|
await ctx.edit(embed=embed)
|
||||||
await ctx.channel.trigger_typing()
|
await ctx.channel.trigger_typing()
|
||||||
embed.description = _desc
|
embed.description = _desc
|
||||||
|
|
Loading…
Reference in a new issue