我有一个从服务器获取随机用户的功能,但我想删除机器人,以便该功能只接受真正的用户
getMember: function (message, toFind = '') {
toFind = toFind.toLowerCase();
let target = message.guild.members.cache.get(toFind);
if (!target && message.mentions.members)
target = message.mentions.members.first();
if (!target && toFind) {
target = message.guild.members.cache.find(member => {
return member.displayName.toLowerCase().includes(toFind) ||
member.user.tag.toLowerCase().includes(toFind)
});
}
if (!target)
target = message.member;
return target;
}
撒科打诨
相关分类