mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-19 18:16:34 +01:00
add a slight error message
This commit is contained in:
parent
44710e4c8c
commit
2f970d4297
1 changed files with 6 additions and 1 deletions
|
@ -866,7 +866,10 @@ class OtherCog(commands.Cog):
|
|||
await interaction.response.defer()
|
||||
_msg = await interaction.followup.send("Converting text to MP3...")
|
||||
text_pre = self.children[0].value
|
||||
try:
|
||||
_io = await _bot.loop.run_in_executor(None, _convert, text_pre)
|
||||
except (Exception, IOError) as e:
|
||||
return await _msg.edit(content="failed. " + str(e))
|
||||
fn = ""
|
||||
_words = text_pre.split()
|
||||
while len(fn) < 28:
|
||||
|
@ -877,6 +880,8 @@ class OtherCog(commands.Cog):
|
|||
if len(fn) + len(word) + 1 > 28:
|
||||
continue
|
||||
fn += word + "-"
|
||||
fn = fn[:-1]
|
||||
fn = fn[:28]
|
||||
await _msg.edit(
|
||||
content="Here's your MP3!",
|
||||
file=discord.File(_io, filename=fn + ".mp3")
|
||||
|
|
Loading…
Reference in a new issue