From 6211ca5d32e965ac812b9f9da97956c2a4eacfd1 Mon Sep 17 00:00:00 2001 From: Armin Date: Sat, 3 May 2025 17:17:32 +0200 Subject: [PATCH] fixed wrong await --- main.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 9cdac97..7464db9 100644 --- a/main.py +++ b/main.py @@ -3,7 +3,6 @@ import os import googletrans import discord from discord import app_commands -from discord.ext import commands discord_bot_token = os.environ['TOKEN_DISCORD'] @@ -53,7 +52,8 @@ async def on_message(ctx: discord.Message): for channel in translator_category.channels: if detected_lang != channel.name: - translated_message = await translator.translate(str(ctx.clean_content), channel.name).text + translated = await translator.translate(str(ctx.clean_content), channel.name) + translated_message = translated.text if str(ctx.clean_content).lower() == str(translated_message).lower(): return @@ -73,6 +73,5 @@ async def on_message(ctx: discord.Message): ### - if __name__ == "__main__": - bot_client.run(discord_bot_token) \ No newline at end of file + bot_client.run(discord_bot_token) -- 2.47.2