Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discord bot Not translating #112

Open
AYMBotBuildersOfficial opened this issue Jun 2, 2024 · 0 comments
Open

Discord bot Not translating #112

AYMBotBuildersOfficial opened this issue Jun 2, 2024 · 0 comments

Comments

@AYMBotBuildersOfficial
Copy link

I am using translate for a discord bot, and when I put with a deepL free API key, it is not translate and when i did error logging I got
An error occurred: Expecting value: line 1 column 1 (char 0)

I tried official given code in the PyPI page but it also not working, it gives error:

Traceback (most recent call last):
File "/home/funz/testing.py", line 9, in
translated_text = translator.translate('the book is on the table')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/funz/end/lib/python3.11/site-packages/translate/translate.py", line 45, in translate
return ' '.join(self.provider.get_translation(text_wraped) for text_wraped in text_list)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/funz/end/lib/python3.11/site-packages/translate/translate.py", line 45, in
return ' '.join(self.provider.get_translation(text_wraped) for text_wraped in text_list)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/funz/end/lib/python3.11/site-packages/translate/providers/deepl.py", line 48, in get_translation
return data["translations"][0]["text"]
~~~~^^^^^^^^^^^^^^^^
KeyError: 'translations'

I think this error might be same reason why bot's script also won't translate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant