[英]my serverlist commands discord bot error, anyone can help me
因为我还是一个初学者,我真的很难解决这个问题......你们能帮帮我吗? 如果你们想在这个问题上帮助我,我将非常感激。
消息创建代码
!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!')],
});
}
}
可能出现此错误的一个原因是因为在Client
中没有称为client.owner
的属性。 但是,您可以使用client.owner
的一种方法是,如果您创建了一个Collection
,然后将其设置为一个数组。 一个例子是这样的:
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)
})
// ...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.