W
W
Wolf_Yout2022-04-07 10:24:12
Python
Wolf_Yout, 2022-04-07 10:24:12

How to translate a fact into Russian?

I ran the following command:

@slash_command(name='cat',description="Увидеть рандомного кошару")
    async def _cat(ctx):
        response = requests.get('https://some-random-api.ml/img/cat') # Get-запрос
        json_data = json.loads(response.text) # Извлекаем JSON
        ter = requests.get('https://some-random-api.ml/facts/cat') # Get-запрос
        factor = json.loads(ter.text)

        embed = discord.Embed(color = 0xff9900, title = 'Милый Котик, осторожно вы влюбуетесь! ',description=f"Рандомный факт о котах - {factor["fact"]}")
        embed.set_image(url = json_data['link']) # Устанавливаем картинку Embed'a
        await ctx.reply(embed = embed) # Отправляем Embed

I tested the command, I noticed that the fact is given in English, but I need it in Russian. How to get a Russian fact or translate English?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dr. Bacon, 2022-04-07
@bacon

Fact - you need to go and read the docs on this api.

K
Killir Vanya229, 2022-04-07
@VEYREN

Use googletrans library

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question