javascript - Discordjs how i can send a embed message with multi link - Stack Overflow

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

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 (mand === '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);

  }
}

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 (mand === '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);

  }
}

Share Improve this question edited Jun 29, 2020 at 14:52 Syntle 5,1743 gold badges15 silver badges34 bronze badges asked Jun 29, 2020 at 14:05 ThiệnThiện 331 silver badge5 bronze badges 2
  • 1 Answers gave the solution but not really the reason, it's using markdown which is sort of just easy styled text, many sites use it including stackoverflow, guides.github./features/mastering-markdown – user13429955 Commented Jun 29, 2020 at 14:57
  • Does this answer your question? Set embed title to a clickable link – Cursed Commented Jun 29, 2020 at 15:22
Add a ment  | 

2 Answers 2

Reset to default 3

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})`;
})
return `/`${i}/ /` [${e.titl.slice(0,50)}](${e.url})`;

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745387757a4625515.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信