mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-19 18:16:34 +01:00
Limit file name lengths
This commit is contained in:
parent
432e9007be
commit
cdbe8c15ba
1 changed files with 10 additions and 9 deletions
|
@ -813,7 +813,7 @@ class OtherCog(commands.Cog):
|
||||||
f"\\* URL: <{friendly_url}>\n"
|
f"\\* URL: <{friendly_url}>\n"
|
||||||
f"\\* Load time: {fetch_time:.2f}ms\n"
|
f"\\* Load time: {fetch_time:.2f}ms\n"
|
||||||
f"\\* Screenshot render time: {screenshot_time:.2f}ms\n"
|
f"\\* Screenshot render time: {screenshot_time:.2f}ms\n"
|
||||||
f"\\* Total time: {(fetch_time + screenshot_time):.2f}ms\n" +
|
f"\\* Total time: {(fetch_time + screenshot_time):.2f}ms\n"
|
||||||
(
|
(
|
||||||
'* Probability of being scat or something else horrifying: 100%'
|
'* Probability of being scat or something else horrifying: 100%'
|
||||||
if ctx.user.id == 1019233057519177778 else ''
|
if ctx.user.id == 1019233057519177778 else ''
|
||||||
|
@ -978,7 +978,8 @@ class OtherCog(commands.Cog):
|
||||||
"logger": logger,
|
"logger": logger,
|
||||||
"format": _format or f"(bv*+ba/bv/ba/b)[filesize<={MAX_SIZE_MB}M]",
|
"format": _format or f"(bv*+ba/bv/ba/b)[filesize<={MAX_SIZE_MB}M]",
|
||||||
"paths": paths,
|
"paths": paths,
|
||||||
"outtmpl": f"{ctx.user.id}-%(title)s.%(ext)s"
|
"outtmpl": f"{ctx.user.id}-%(title)s.%(ext)s",
|
||||||
|
"trim_file_name": 128,
|
||||||
}
|
}
|
||||||
) as downloader:
|
) as downloader:
|
||||||
try:
|
try:
|
||||||
|
@ -1059,11 +1060,11 @@ class OtherCog(commands.Cog):
|
||||||
units.pop(0)
|
units.pop(0)
|
||||||
embed.description += "\N{warning sign}\ufe0f {} is too large to upload ({!s}{}" \
|
embed.description += "\N{warning sign}\ufe0f {} is too large to upload ({!s}{}" \
|
||||||
", max is {}MB{}).\n".format(
|
", max is {}MB{}).\n".format(
|
||||||
file.name,
|
file.name,
|
||||||
round(st_r, 2),
|
round(st_r, 2),
|
||||||
units[0],
|
units[0],
|
||||||
MAX_SIZE_MB,
|
MAX_SIZE_MB,
|
||||||
', compressing failed' if COMPRESS_FAILED else ', compressed fine.'
|
', compressing failed' if COMPRESS_FAILED else ', compressed fine.'
|
||||||
)
|
)
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
|
@ -1090,7 +1091,7 @@ class OtherCog(commands.Cog):
|
||||||
except discord.NotFound:
|
except discord.NotFound:
|
||||||
pass
|
pass
|
||||||
self.bot.loop.create_task(bgtask())
|
self.bot.loop.create_task(bgtask())
|
||||||
|
|
||||||
@commands.slash_command(name="text-to-mp3")
|
@commands.slash_command(name="text-to-mp3")
|
||||||
@commands.cooldown(5, 600, commands.BucketType.user)
|
@commands.cooldown(5, 600, commands.BucketType.user)
|
||||||
async def text_to_mp3(
|
async def text_to_mp3(
|
||||||
|
@ -1209,7 +1210,7 @@ class OtherCog(commands.Cog):
|
||||||
try:
|
try:
|
||||||
mp3, size = await asyncio.wait_for(
|
mp3, size = await asyncio.wait_for(
|
||||||
_bot.loop.run_in_executor(None, _convert, text_pre),
|
_bot.loop.run_in_executor(None, _convert, text_pre),
|
||||||
timeout=300
|
timeout=600
|
||||||
)
|
)
|
||||||
except asyncio.TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
task.cancel()
|
task.cancel()
|
||||||
|
|
Loading…
Reference in a new issue