iamtraction / google-translate

🈯 A Node.JS library to consume Google Translate API for free.
https://npmjs.com/@iamtraction/google-translate
MIT License
540 stars 73 forks source link

HTTP Error #32

Closed aarabii closed 2 years ago

aarabii commented 3 years ago

hey i was trying to make a translate command for my discord bot but i'm facing HTTPSError i have a simple code like this const arLang = await translate(Message, { to: 'ar' }); where Message is a message from a author and then it will send the translation to the discord channel and there is a catch block for err which gives HTTPError so IDK what should i do if you want i can provide you whole code too

note: 1st i thought i get this err cuz m trying to get 10 translation so i removed 9 of them but still the err was there

iamtraction commented 3 years ago

Can you send the entire error log?

aarabii commented 3 years ago

`/home/runner/Touka-Kirshima/node_modules/@iamtraction/google-translate/src/index.js:142 let error = new Error(); ^

Error [HTTPError] at translate (/home/runner/Touka-Kirshima/node_modules/@iamtraction/google-translate/src/index.js:142:25) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async InteractionCollector. (/home/runner/Touka-Kirshima/SlashCommands/ContextMenu/translate.js:115:22) { statusCode: undefined, statusMessage: undefined`

ElesGergo commented 3 years ago

I am getting the same error as @losier. Any suggestions?

Sagar409-conflict commented 2 years ago

I am also getting same error.

{ HTTPError
    at translate (/var/www/html/sawem/api/node_modules/@iamtraction/google-translate/src/index.js:142:25)
    at process._tickCallback (internal/process/next_tick.js:68:7)
  name: 'HTTPError',
  statusCode: undefined,
  statusMessage: undefined }
iamtraction commented 2 years ago

Most likely a rate limit error. try with the latest version of the library. It'll show a more detailed error object.