我正在寻找一种方法来获得版主已经完成的禁令数量,这是我到目前为止所拥有的。我猜我得遍历每一条禁令?
let targetMod = message.mentions.users.first()
message.guild.bans.fetch().then((bans) => {
bans.forEach((ban) => {
//My problem is here, I dont know how to check who did the ban
})
})
发布于 2021-11-21 13:12:31
信息中实际上并没有提供版主。您将需要检查审核日志(将仅返回到特定时间,它不是完全准确的)
let logs = await message.guild.fetchAuditLogs()
logs = logs.entries.filter(e => e.action === "MEMBER_BAN_ADD")
logs = logs.entries.filter(e => e.executor?.id === targetMod.id)
console.log(logs.size) //should be the rough amount of bans
https://stackoverflow.com/questions/70058325
复制相似问题