【问题标题】:Having Issues with "Client" inside MessageEmbedMessageEmbed 中的“客户端”存在问题
【发布时间】:2020-06-05 01:10:08
【问题描述】:

代码:

    const specifyembed = new Discord.MessageEmbed()
    .setAuthor("Auto-Partner", client.user.displayAvatarURL())
    .setThumbnail(client.user.displayAvatarURL())
    .setDescription("**__Want to grow fast?__** \nWith this bot you can gain up to **3,000 Members** per week! \nThis bot will share your server in many active servers and to many active users! \nSimply add me to your server and use the command ``-partner {MESSAGE}``")
    .addFields([
        {
            name: '**__Bot Invite Link:__**',
            value: '[- Click To Add Bot -](your link goes here)'
        }
      ])
    .setTimestamp()
    .setFooter("© Auto-Partner")

    if(!args[0]) return message.channel.send(specifyembed)

错误:

(node:7920) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'client' of undefined

因此,如果有人对如何解决此问题有任何解决方案,请帮助我。

【问题讨论】:

  • 请您分享您的其余代码(当然要删除令牌)?我不认为你的错误发生在这个代码块中,我不知道变量“client”是什么。谢谢!
  • 是的,我还是一样,我在 index.js 中缺少一行代码,所以我修复了它
  • 您能分享您的所有代码吗?我真的不认为这个部分有错误。编辑:确保从共享代码中删除令牌。
  • 我修好了别担心
  • @rez 你能在答案部分添加你自己的解决方案吗?

标签: discord.js


【解决方案1】:

问题出在 util.js 和命令处理程序中,我没有将 util.js 与命令处理程序连接,这取决于您的问题希望这个问题有所帮助,我知道它可以依赖。

【讨论】:

    猜你喜欢
    • 2020-07-17
    • 2020-09-22
    • 1970-01-01
    • 2018-03-26
    • 2021-02-25
    • 2011-11-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多