So, I have a command that should send random fact and translate it from English to Ukrainian, but instead of getting a random fact, it's just showing [object Object]. Here is my code, I'm on discord.js v13.
const { MessageEmbed } = require('discord.js');
const fetch = require('node-fetch');
const translate = require('@iamtraction/google-translate');
module.exports = {
name: 'fact',
description: 'Випадковий факт',
category: 'Fun',
async run({ interaction, bot }) {
const response = await fetch('https://uselessfacts.jsph.pl/random.json?language=en');
await response.json().then(async res => {
const translated = await translate(res, { to: 'uk' });
interaction.reply({
embeds: [new MessageEmbed().setTitle('Факт').setDescription(translated.text).setColor('RANDOM')]
});
});
}
};