Reputation: 33
I want to make the embed message like the regular music bot like this embed message with the link can click
I want my content is the Description will show and the highlight is a link attach to it like the picture. and here is my embed
here's my code
if (command === 'test') {
var search = message.content.split(/\s+/g).slice(1).join(" ");
if (!search.length) {
return message.channel.send("PLs enter a name!");
}
else {
const puppeteer = require("puppeteer");
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto(`https://i hide website cause privacy?keyword=${search}`);
let Anime = await page.evaluate(() => {
let items = document.querySelectorAll('ul[class= "last-film-box"] > li > a');
let links = [];
items.forEach(item => {
links.push({
titl: item.title,
url: item.href
});
});
return links;
});
let i = 0;
let content = Anime.map(e => {
i++;
return i + "/ " + `${e.titl.slice(0, 50)} ${e.url}`;
})
let ContentEmbed = new Discord.MessageEmbed();
ContentEmbed.setTitle("Here the result");
ContentEmbed.setDescription(content);
message.channel.send(ContentEmbed);
}
}
Upvotes: 3
Views: 5277
Reputation: 5174
You can use [Video Title](Video Link)
to achieve that
let content = Anime.map(e => {
i++;
return `${i}/ [${e.titl.slice(0, 50)}](${e.url})`;
})
Upvotes: 3