Sending an image without the link showing with discord library
12,469
As user4261590 wrote, you can use embeds to achieve this. Here's an example that might work for you:
case 'happy':
const embed = {
"image": {
"url": "https://pictureexample.jpg"
}
};
bot.sendMessage({
to: channelID,
message: embed
});
Related videos on Youtube
Author by
Julian L
Updated on June 04, 2022Comments
-
Julian L almost 2 years
I would like my discord bot to send an image (from a url), but have the url be hidden from the message that is sent in chat. For sending messages, im using a switch statement that only uses the writing after an "!"
case 'happy': bot.sendMessage({ to: channelID, message: 'https://pictureexample.jpg' });
How would I send messages without having the link show in chat?
-
user4261590 about 6 yearsIf you use an embed you can set its image property and it will show the image without the URL.
-