Попробовал код:
client.on('guildMemberAdd', member => {
member.guild.fetchInvites().then(guildInvites => {
// This is the *existing* invites for the guild.
const ei = invites[member.guild.id];
// Update the cached invites for the guild.
invites[member.guild.id] = guildInvites;
// Look through the invites, find the one for which the uses went up.
const invite = guildInvites.find(i => ei.get(i.code).uses < i.uses);
// This is just to simplify the message being sent below (inviter doesn't have a tag property)
const inviter = client.users.cache.find(invite.inviter.id);
console.log(inviter.tag)
})
})
Выдаёт ошибку
Cannot read property 'get' of undefined
Может быть я туплю...