From 70f78917f4c706562a7c6a188fbf5aee5511da20 Mon Sep 17 00:00:00 2001 From: insert-usernamehere Date: Sun, 16 Apr 2023 12:34:58 -0400 Subject: [PATCH] use embeds --- .env.example | 2 +- transcribebot.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.env.example b/.env.example index a13f59b..2e2bfd8 100644 --- a/.env.example +++ b/.env.example @@ -1 +1 @@ -TOKEN = "bottoken \ No newline at end of file +TOKEN = "bottoken" \ No newline at end of file diff --git a/transcribebot.py b/transcribebot.py index bdc6264..f700ba0 100644 --- a/transcribebot.py +++ b/transcribebot.py @@ -18,7 +18,7 @@ def prepaudio(audiofile): transcribeaudo = st.record(sounds) return transcribeaudo -@bot.message_command(name="Transcrible Using Sphinx") +@bot.message_command(name="Transcribe Using Sphinx") async def transcribesphinx(inter: disnake.ApplicationCommandInteraction, message: disnake.Message): try: await inter.response.defer(ephemeral='true') @@ -29,13 +29,15 @@ async def transcribesphinx(inter: disnake.ApplicationCommandInteraction, message except Exception as e: await inter.edit_original_message(content=f'an error appears to have occoured please report it to the developer: {e}') -@bot.message_command(name="Transcrible Using Google") +@bot.message_command(name="Transcribe Using Google") async def transcribesphinx(inter: disnake.ApplicationCommandInteraction, message: disnake.Message): try: await inter.response.defer(ephemeral='true') await message.attachments[0].save("audio.ogg") # WARNING Google is propritary, consider disabling however sphynix is currently not very good so this provides an option - await inter.edit_original_message(content=st.recognize_google(prepaudio("audio.ogg"))) + embed=disnake.Embed(title=st.recognize_google(prepaudio("audio.ogg")), color=0x3584e4) + embed.set_author(name=message.author.display_name, url=message.jump_url, icon_url=message.author.display_avatar) + await inter.edit_original_message(embed=embed) os.remove("audio.ogg") os.remove("audio.wav") except Exception as e: