0

I'm making a discord.py bot and I'm trying to make some commands with the googletrans module for translation.

My code was running just fine last night but when I tried it this morning, the language detection command wasn't working anymore, and I haven't even changed anything. Here's the code

import discord
from discord.ext import commands
import googletrans
from googletrans import Translator


client = commands.Bot(command_prefix=".")


@client.command()
async def languages(ctx, *, input):
    translator = Translator()
    await ctx.send(translator.detect(f'{input}'))

client.run(Token)

All the other bot commands are working fine, including the ones using the googletrans module, and there are no error messages. Any explanation why it worked the first day, but not the after that?

Stevoisiak
  • 23,794
  • 27
  • 122
  • 225
  • The googletrans library is not an official Google Cloud API, and according to its documentation:" this API does not guarantee that the library would work properly at all times", additionally, you can post the issues you are presenting at: https://github.com/ssut/py-googletrans/issues – Aldo González Ramírez Dec 01 '20 at 23:20
  • I didn't know that. Thanks a lot for the help! – Whatsdeproblem Dec 02 '20 at 08:28
  • The solution here might help: https://stackoverflow.com/questions/65095668/googletrans-api-attributeerror/65109962#65109962 – Moritz Dec 02 '20 at 14:24

0 Answers0