我的代码有什么问题?我没有收到错误;我从来没有得到任何回应

Whats wrong with my code? I don't get an error; I get no response what so ever

我不明白我的代码有什么问题...

用法:

/建议

bot 向频道名称建议发送建议 这是我的代码:

if(cmd === `${prefix}suggest`){

  // USAGE: 
  // /suggest this is the suggestion

  let suggestion = args.join(" ").slice(22);

  let suggestEmbed = new Discord.RichEmbed()
  .setDescription("~~-------~~**__NEW SUGGESTION!__**~~-------~~")
  .setColor("#ff0000")
  .addField("Suggestion By", `${message.author} (${message.author.id})`)
  .addField("Channel", message.channel)
  .addField("Time", message.createdAt)
  .addField("Suggestion", suggestion)
  .setTimestamp()
  .setFooter("Use /invite to invite me to your server!");

  let suggestchannel = message.guild.channels.find(`name`, "suggestions");
  if(!suggestchannel) return message.channel.send("Couldn't find suggestions channel. Please **create one for this command to work!**");


  message.delete().catch(O_o=>{});
  suggestchannel.send(suggestEmbed);

  return;
}

您的代码行有误 suggestchannel.send(...)。您不能将嵌入作为 消息内容 发送,因为此 必须是字符串 。 您可以在这里找到更多相关信息:https://discord.js.org/#/docs/main/stable/class/TextChannel?scrollTo=send

这是更正后的代码,请尝试使用以下代码:

if (cmd === `${prefix}suggest`) {
    // USAGE:
    // /suggest this is the suggestion

    const suggestion = args.join(' ').slice(22);

    const suggestEmbed = new Discord.RichEmbed()
        .setDescription('~~-------~~**__NEW SUGGESTION!__**~~-------~~')
        .setColor('#ff0000')
        .addField('Suggestion By', `${message.author} (${message.author.id})`)
        .addField('Channel', message.channel)
        .addField('Time', message.createdAt)
        .addField('Suggestion', suggestion)
        .setTimestamp()
        .setFooter('Use /invite to invite me to your server!');

    const suggestchannel = message.guild.channels.find(`name`, 'suggestions');
    if (!suggestchannel) return message.channel.send("Couldn't find suggestions channel. Please **create one for this command to work!**");


    message.delete().catch(O_o => {});
    suggestchannel.send({ embed: suggestEmbed });
}