Skip to content

Commit

Permalink
Fix #67
Browse files Browse the repository at this point in the history
  • Loading branch information
saiteja-madha committed Dec 8, 2021
1 parent 64b1cd0 commit 9751d5f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/commands/fun/facts.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module.exports = class FactCommand extends Command {
command: {
enabled: true,
usage: "<animal>",
aliases: ["fact"],
minArgsCount: 1,
},
slashCommand: {
Expand Down Expand Up @@ -61,10 +62,12 @@ async function getFact(user, choice) {
const response = await getJson(`${BASE_URL}/${choice}`);
if (!response.success) return MESSAGES.API_ERROR;

const imageUrl = response.data?.fact;
const fact = response.data?.fact;
const imageUrl = response.data?.image;
const embed = new MessageEmbed()
.setColor(EMBED_COLORS.TRANSPARENT)
.setImage(imageUrl)
.setThumbnail(imageUrl)
.setDescription(fact)
.setFooter(`Requested by ${user.tag}`);

return { embeds: [embed] };
Expand Down

0 comments on commit 9751d5f

Please sign in to comment.