admin管理员组文章数量:1424384
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
2 Answers
Reset to default 3You 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})`;
本文标签: javascriptDiscordjs how i can send a embed message with multi linkStack Overflow
版权声明:本文标题:javascript - Discordjs how i can send a embed message with multi link - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745387757a2656451.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论