From 258db180a7bfbd45c5f73e38a04f612f6c7945b8 Mon Sep 17 00:00:00 2001 From: insert-usernamehere Date: Sat, 15 Apr 2023 10:14:54 -0400 Subject: [PATCH] defer again and make empherial --- transcribebot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/transcribebot.py b/transcribebot.py index 28edbc2..ad71532 100644 --- a/transcribebot.py +++ b/transcribebot.py @@ -12,7 +12,7 @@ bot = commands.Bot(command_prefix='.') @bot.message_command(name="Transcrible") async def transcribe(inter: disnake.ApplicationCommandInteraction, message: disnake.Message): - await inter.response.defer() + await inter.response.defer(ephemeral='true') # Reversing the message and sending it back. await message.attachments[0].save("audio.ogg") mp3file = AudioSegment.from_ogg("audio.ogg") @@ -20,7 +20,7 @@ async def transcribe(inter: disnake.ApplicationCommandInteraction, message: disn convertemessage = sr.AudioFile("audio.wav") with convertemessage as sounds: transcribeaudo = st.record(sounds) - await inter.response.send_message(st.recognize_sphinx(transcribeaudo), file=disnake.File("audio.wav")) + await inter.edit_original_message(st.recognize_sphinx(transcribeaudo), file=disnake.File("audio.wav")) os.remove("audio.ogg") os.remove("audio.wav")