GoogleTrans integration fails due to a specific language choice

Viewed 18

So I integrated GoogleTrans to discord.py using the original recommended code and everything worked, yet when I tried to remove the language choice, making that it only translates to Lithuanian, it didn't work.

Here's my code. I guess the bad thing is dest=lt because it doesn't recognize what lt is probably.

async def translate(ctx, args):
    t = Translator()
    a = t.translate(args, dest=lt)
    embed=discord.Embed(title="Translation completed", description="The translation may be incorrect.")
    embed.add_field(name=":flag_gb:  >>  :flag_lt:", value=a.text)
    await ctx.send(embed=embed) 

Basically, the code was async def translate(ctx, language, *, args):, but I didn't want for people to choose the language, I wanted them to have only one language, but when I tried to do that, it didn't work. Any ideas?

0 Answers
Related