From 59ca151e673e9e82615b7b9250cf3efb1a0057d4 Mon Sep 17 00:00:00 2001 From: insert-usernamehere Date: Sun, 16 Apr 2023 13:35:20 -0400 Subject: [PATCH] remove buttons, its too much work for no bennifit --- transcribebot.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/transcribebot.py b/transcribebot.py index 8189f36..d265f9e 100644 --- a/transcribebot.py +++ b/transcribebot.py @@ -25,7 +25,8 @@ async def transcribesphinx(inter: disnake.ApplicationCommandInteraction, message await inter.response.defer(ephemeral='true') await message.attachments[0].save("audio.ogg") embed=disnake.Embed(title=st.recognize_sphinx(prepaudio("audio.ogg")), color=0x3584e4) - embed.set_author(name=message.author.nick, url=message.jump_url, icon_url=message.author.display_avatar) + embed.set_author(name=message.author.display_name, url=message.jump_url, icon_url=message.author.display_avatar) + embed.set_footer(text="Accuracy not guaranteed") await inter.edit_original_message(embed=embed) os.remove("audio.ogg") os.remove("audio.wav") @@ -40,23 +41,13 @@ async def transcribesphinx(inter: disnake.ApplicationCommandInteraction, message # WARNING Google is propritary, consider disabling however sphynix is currently not very good so this provides an option 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, components=[disnake.ui.Button(label="See more posibilites", style=disnake.ButtonStyle.success, custom_id="gp")]) + embed.set_footer(text="Accuracy not guaranteed") + await inter.edit_original_message(embed=embed) await asyncio.sleep(3) os.remove("audio.ogg") os.remove("audio.wav") 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.listen("on_button_click") -async def extratranscribe(inter: disnake.MessageInteraction): - if inter.component.custom_id == "gp": - try: - await inter.response.defer(ephemeral='true') - await inter.attachments[0].save("audio.ogg") - embed=disnake.Embed(title=st.recognize_google(prepaudio("audio.ogg"), show_all=True), color=0x3584e4) - embed.set_author(name=inter.author.nick, url=inter.jump_url, icon_url=inter.author.display_avatar) - await inter.edit_original_message(embed=embed) - except Exception as e: - await inter.edit_original_message(content=f'The interaction has expiredS') bot.run(os.getenv("TOKEN")) \ No newline at end of file