FBILOLIGIRL
FBILOLIGIRL

Reputation: 69

how to hide links in discord.js

I've got this code

client.on('message', message => {
    if (message.content === `L!succ`) {
    // message goes below!
        message.channel.send('https://cdn.discordapp.com/attachments/525096492470370314/653855352877481984/8742_Succ.gif');
        }
});

It's good and all but I wanna hide the url I've tried the following

client.on('message', message => {
    // If the message is '!rip'
    if (message.content === '!rip') {
    // Create the attachment using MessageAttachment
    const attachment = new MessageAttachment('https://i.imgur.com/w3duR07.png');
    // Send the attachment in the message channel
    message.channel.send(attachment);
    }
});

(so trying to attach it) So I want to make the link disappear and just make it become just the gif itself hopefully someone can help me with this?

Upvotes: 1

Views: 10539

Answers (2)

M. Euler
M. Euler

Reputation: 46

Its now like this:

client.on("message", msg => {
    let embed = new Discord.MessageEmbed();
    attachment.setImage("Your URL");
    msg.reply(embed);
});

The RichEmbed is not available anymore

Upvotes: 1

Cipher
Cipher

Reputation: 2722

WITH Attachment as file

client.on('message', message => {
    // If the message is '!rip'
    if (message.content === '!rip') {
        // Create the attachment using Attachment
        const attachment = new Attachment('https://i.imgur.com/w3duR07.png');
        // Send the attachment in the message channel
        message.channel.send(attachment);
    }
});

WITH Embeded IMAGE

client.on('message', message => {
    if (message.content === '!rip') {
    let embed = new Discord.RichEmbed()
        embed.setImage('https://i.imgur.com/w3duR07.png')
    message.channel.send(embed);
    }
});

Upvotes: 0

Related Questions