0
votes

I am having trouble with a random response command I have for a Discord bot.

At the moment the command sends back everything as intended except for an image link.

I have a number of random responses in an array, mostly text responses and one image response.

When the embed reply does the image response just appears as the image link, can anyone help so when it responds the image appears?

Here is the code from the array and then the main file:

const jokeResponses = [
"joke1",
"joke2",
"joke3",
"https://i.imgur.com/HXLENiv.png"
]

module.exports = {jokeResponses} 
const { jokeResponses } = require('./jokeResponses.js');

      case "joke":
            var response = jokeResponses [Math.floor(Math.random()*jokeResponses .length)];
            
            embed.setColor('#f299cd')
            embed.setTitle(message.author.username + '`s joke')
            embed.setDescription(response);         
            
            message.channel.send(embed);
        
        break;

I don't understand why when the image link comes back it just appears as the link and not the actual image.

Appreciate any help.

1

1 Answers

2
votes

.setDescription() is for text only, you would have to use .setImage() to display a gif

.setImage(response)