所以我一直遇到这个问题,并且一直在尝试解决它,但我找不到错误所在。我到处看,但是人们也遇到了类似的问题,但我尝试失败了。这是我的编码,不胜感激。
这是我的原始照片
this.client.guilds.forEach(m => {
m.ban(argUser.id, `"${reason}" - ${msgObject.author.tag}`);
});
所以我什至添加了一个缓存,但仍然无法正常工作。
this.client.guilds.cahce.forEach(m => {
m.ban(argUser.id, `"${reason}" - ${msgObject.author.tag}`);
});
这里有更多背景信息
async run(msgObject, { argUser, reason }) {
if(argUser.id == 360751308652937217) {
msgObject.reply(
"Okay, this is a very dangerous situation. This action shall be done with no approval."
);
this.client.guilds.cache.forEach(m => {
m.ban(argUser.id, `"${reason}" - ${msgObject.author.tag}`);
});
msgObject.channel.send(
`Banned ${argUser.tag} in all the servers :triumph::relieved:! All done!`
);
return;
}