找不到固定消息的方法
Can't find a way to pin messages
我正在尝试创建一个 bot discord,我想确保从 bot 发送的消息“msg.channel.send(exampleEmbed)”将立即固定。我试图查看文档,但找不到任何有用的东西。
有人知道怎么做吗?
db.each('SELECT * FROM BossTable', function (err, output) {
//msg.channel.send(`\`\`\` CH: ${output.channel} Map: ${output.map} Location: ${output.location} HP: ${output.hp}\`\`\``);
const exampleEmbed = new Discord.MessageEmbed()
.setColor('#FDA50F')
.setTitle(output.channel)
.setThumbnail('https://icon2.cleanpng.com/20180927/qkl/kisspng-poring-ragnarok-online-clip-art-image-window-5bad7a5208e587.3708730015380956980365.jpg')
.addFields(
{ name: 'Map', value: output.map, inline: true },
{ name: 'Location', value: output.location+(" oclock") },
{ name: 'HP', value: output.hp,inline: true },
)
.setTimestamp();
msg.channel.send(exampleEmbed)
});
您可以使用 Message.pin()
实现此目的
msg.channel.send(exampleEmbed).then((msg) => msg.pin())
我正在尝试创建一个 bot discord,我想确保从 bot 发送的消息“msg.channel.send(exampleEmbed)”将立即固定。我试图查看文档,但找不到任何有用的东西。
有人知道怎么做吗?
db.each('SELECT * FROM BossTable', function (err, output) {
//msg.channel.send(`\`\`\` CH: ${output.channel} Map: ${output.map} Location: ${output.location} HP: ${output.hp}\`\`\``);
const exampleEmbed = new Discord.MessageEmbed()
.setColor('#FDA50F')
.setTitle(output.channel)
.setThumbnail('https://icon2.cleanpng.com/20180927/qkl/kisspng-poring-ragnarok-online-clip-art-image-window-5bad7a5208e587.3708730015380956980365.jpg')
.addFields(
{ name: 'Map', value: output.map, inline: true },
{ name: 'Location', value: output.location+(" oclock") },
{ name: 'HP', value: output.hp,inline: true },
)
.setTimestamp();
msg.channel.send(exampleEmbed)
});
您可以使用 Message.pin()
msg.channel.send(exampleEmbed).then((msg) => msg.pin())