【发布时间】:2018-08-18 16:57:08
【问题描述】:
基本上我在做这个歌词命令,而且很多时候,大多数歌曲的歌词中的字符数超过了 2000 个字符,这超过了 Discord 的限制。我想知道如何让它一次发送 2 条不同的消息。
我想知道如何让它在一条消息中发送前 2000 个字符,然后在第二条消息中发送剩余的字符。
这是我的代码:
if (message.content.startsWith(config.prefix + `lyrics`)) {
var artistTitle = getArtistTitle(serverQueue.songs[0].title)
console.log(artistTitle)
lyrics.get(artistTitle[0], artistTitle[1], function(err, res){
if(err){
return message.channel.send({embed: {
title: `:x: | Oops! I have encountered an error!`,
description: err,
color: 0xDE2E43
}})
console.log(err);
}
else{
return message.channel.send({embed: {
title: `Lyrics for ${serverQueue.songs[0].title}. Requested by ${message.author.username}`,
description: res,
footer: {
icon_url: serverQueue.songs[0].thumbnail,
text: `Powered by lyrics.wikia.com`
}
}})
}
});
}
【问题讨论】:
-
这是我现在的代码pastebin.com/j6bbF4TB
-
请将您的相关代码添加到问题中,而不仅仅是在 pastebin 链接中
-
从您 pastebin 上的代码来看,您似乎想将所有歌词文本作为
embed发送? -
是的,当字符数超过 2000 时,我想发送 2 个不同的嵌入
标签: javascript node.js discord discord.js