我的serverlist命令DISCORD机器人错误,任何人都可以帮助我

发布于 2025-02-12 23:38:13 字数 781 浏览 1 评论 0原文

既然我还是初学者,我真的很努力地解决这个问题...你们能帮我吗?如果你们想在这个问题上为我提供帮助,我非常感谢。

messageCreate代码

!channel.permissionsFor(message.guild.me)?.has(Permissions.FLAGS.EMBED_LINKS) &&
      client.user.id !== userId
    ) {
      return channel.send({ content: `Error: I need \`EMBED_LINKS\` permission to work.` });
    }
    if (command.owner) {
      if (client.owner) {
        const devs = client.owner.find((x) => x === message.author.id);
        if (!devs)
          return message.channel.send({
            embeds: [embed.setDescription('Only <@959276033683628122> can use this command!')],
          });
      }
    }

错误logs

since I'm still a beginner, I'm really struggling to fix this... can you guys help me? i am very grateful if you guys want to help me on this issue.

MessageCreate code

!channel.permissionsFor(message.guild.me)?.has(Permissions.FLAGS.EMBED_LINKS) &&
      client.user.id !== userId
    ) {
      return channel.send({ content: `Error: I need \`EMBED_LINKS\` permission to work.` });
    }
    if (command.owner) {
      if (client.owner) {
        const devs = client.owner.find((x) => x === message.author.id);
        if (!devs)
          return message.channel.send({
            embeds: [embed.setDescription('Only <@959276033683628122> can use this command!')],
          });
      }
    }

Error Logs

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

々眼睛长脚气 2025-02-19 23:38:14

此错误可能出现的原因之一是因为没有属性称为client.houter.houter in client 。但是一种方法,您可以使用client.owner是如果您创建了 集合 ,然后将其设置为数组。一个例子就是这样:

import { Collection } from 'discord.js'
// ...
client.owner = new Collection()
const ownerArray = [{
    username: '',
    id: ''
}] // Use something like a hardcoded value for the array of owners
ownerArray.forEach(owner => {
    client.owner.set(owner.id, owner.username)
})
// ...

One reason why this error could be coming is because there is no property called as client.owner in a Client. But one way, you could use client.owner is if you created a Collection and then set it to an array. An example would be like this:

import { Collection } from 'discord.js'
// ...
client.owner = new Collection()
const ownerArray = [{
    username: '',
    id: ''
}] // Use something like a hardcoded value for the array of owners
ownerArray.forEach(owner => {
    client.owner.set(owner.id, owner.username)
})
// ...
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文