Thiện
Thiện

Reputation: 33

Discordjs how i can send a embed message with multi link

I want to make the embed message like the regular music bot like this embed message with the link can click

enter image description here

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

enter image description here

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

Answers (2)

Syntle
Syntle

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

Cursed
Cursed

Reputation: 1003

return `/`${i}/ /` [${e.titl.slice(0,50)}](${e.url})`;

Upvotes: 1

Related Questions