Skip to content
Advertisement

Translation in discord.py bot doesn’t work

I’ve been trying to make my discord bot translate texts using a module called googletrans. It seems fairly simple and it should have worked without any hassle, or so I thought.

So after my import statements, I have translator = Translator(). My following cog code is:

JavaScript

But it shows this error: discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'group'. Where am I going wrong? Any help would be much appreciated!

Edit: the full traceback:

JavaScript

Advertisement

Answer

I had a same problem. Installing alpha version of google trans helped, so try doing this:

JavaScript

And:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement