我不想把不和谐的东西埋进去。这是我的密码:
module.exports = {
name: 'tiktok',
description: "sends tiktok link",
execute(message, args, Discord) {
const newEmbed = new Discord.MessageEmbed()
.setColor('#228B22')
.setTitle('Tiktok')
.setURL('https://www.tiktok.com/@elcattuccino?lang=en')
.setDescription('tiktok link for the discord server')
.addFields(
{name: 'Tiktok', value:'heres the tiktok link'},
)
.setImage('https://cdn.discordapp.com/avatars/752212130870329384/6a16609eafc28f95ad8f64e80ffcc24e.png?size=80')
.setFooter('check out the tiktok');
message.channel.send(newEmbed);
}
}但我知道这个错误:
抛出新的DiscordAPIError(数据、res.status、请求);^ Bot\node_modules\discord.js\src\rest\RequestHandler.js:349:13):DiscordAPIError:无法在异步RequestHandler.push (C:\Users\willm\OneDrive\Desktop)的异步RequestHandler.push(节点:内部/进程/任务队列:96:5)发送空消息(C:\Users\willm\OneDrive\Desktop\Discord异步TextChannel.send (C:\Users\willm\OneDrive\Desktop)不和Bot\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:172:15) {方法:'post',路径:'/channels/910099863180550144/messages', 代码: 50006,httpStatus: 400,requestData:{ json:{内容:未定义,tts: false,undefined,undefined,嵌入:未定义,组件:未定义,用户名:未定义,avatar_url:未定义,allowed_mentions:未定义,标志:未定义,message_reference:未定义,附件:未定义,sticker_ids:未定义},文件:[] }}
发布于 2021-11-16 10:54:47
如果您使用的是discord.js v13,您应该发送这样的嵌入,因为您现在最多可以发送10个嵌入:
message.channel.send({ embeds: [newEmbed] });嵌入选项被移除并替换为嵌入数组,该数组必须位于options对象中。更多信息
发布于 2021-11-16 16:16:15
使用message.channel.send({ embeds: [newEmbed] });
此外,字段已更改。
像这样的.addField('LINK', '[LINK](TIKTOK LINK)', true)
https://stackoverflow.com/questions/69987766
复制相似问题