
The above exception was the direct cause of the following exception:įile "C:\Users\wave computer\PycharmProjects\pythonProject\venv\lib\site-packages\discord\ext\commands\bot.py", line 902, in invokeįile "C:\Users\wave computer\PycharmProjects\pythonProject\venv\lib\site-packages\discord\ext\commands\core.py", line 864, in invokeįile "C:\Users\wave computer\PycharmProjects\pythonProject\venv\lib\site-packages\discord\ext\commands\core.py", line 94, in wrappedĭ.CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'group'
#Auto translate bot full
Where am I going wrong? Any help would be much appreciated!Įdit: the full traceback: Ignoring exception in command translate:įile "C:\Users\wave computer\PycharmProjects\pythonProject\venv\lib\site-packages\discord\ext\commands\core.py", line 85, in wrappedįile "C:\Users\wave computer\PycharmProjects\pythonProject\cogs\translate.py", line 13, in translateįile "C:\Users\wave computer\PycharmProjects\pythonProject\venv\lib\site-packages\googletrans\client.py", line 255, in detectĭata = self._translate(text, 'en', 'auto', kwargs)įile "C:\Users\wave computer\PycharmProjects\pythonProject\venv\lib\site-packages\googletrans\client.py", line 78, in _translateįile "C:\Users\wave computer\PycharmProjects\pythonProject\venv\lib\site-packages\googletrans\gtoken.py", line 194, in doįile "C:\Users\wave computer\PycharmProjects\pythonProject\venv\lib\site-packages\googletrans\gtoken.py", line 62, in _updateĬode = self.RE_TKK.search(r.text).group(1).replace('var ', '')ĪttributeError: 'NoneType' object has no attribute 'group' Translation = anslate(message)Įmbed = discord.Embed(color=_theme())Įmbed.add_field(name=f"Language: ')īut it shows this error: .CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'group'.
#Auto translate bot code
My following cog code is: "Tl", "Translate"])Īsync def translate(self, ctx, *, message): So after my import statements, I have translator = Translator(). It seems fairly simple and it should have worked without any hassle, or so I thought.
#Auto translate bot how to
Learn how to add translation to your bot in the Azure Bot Service Documentation tutorial.I've been trying to make my discord bot translate texts using a module called googletrans. Whether you’re communicating with customers or internal team members, multilingual bots can increase the number of users that can use your bot in their preferred language. The Microsoft Translator API service allows bots to interact in over 60 supported languages. Use the Translator API for multilingual translationsĪdding translation to your bot allows it to reach a larger audience without changing significant parts of your bot’s core programming. Bots can be used in scenarios such as customer support to answer customer questions without the need of a human customer support representative. It may be a simple question and answer dialog bot, or a sophisticated bot that allows people to interact with other services in an intelligent manner using AI.

What’s a bot?Ī bot is an app that users interact with in a conversational way using text, graphics, or speech. Are you looking to add multilingual support to your bot? Using the Azure Bot Service V4 SDK, your bot can use Microsoft Translator to automatically translate messages to the language your bot understands, and optionally translate the bot’s replies back to the user’s language.
