Ad
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?
Ad
Answer
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);
}
});
Ad
source: stackoverflow.com
Related Questions
- → How to update data attribute on Ajax complete
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → Octobercms Component Unique id (Twig & Javascript)
- → Passing a JS var from AJAX response to Twig
- → Laravel {!! Form::open() !!} doesn't work within AngularJS
- → DropzoneJS & Laravel - Output form validation errors
- → Import statement and Babel
- → Uncaught TypeError: Cannot read property '__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED' of undefined
- → React-router: Passing props to children
- → ListView.DataSource looping data for React Native
- → Can't test submit handler in React component
- → React + Flux - How to avoid global variable
- → Webpack, React & Babel, not rendering DOM
Ad