GUH
This commit is contained in:
parent
36a7194b49
commit
832514ca90
14
index.js
14
index.js
|
@ -382,13 +382,11 @@ client.on('inviteCreate', (invite) => { //if someone creates an invite while bot
|
|||
});
|
||||
|
||||
client.on('guildMemberAdd', async (member) => { // We're just gonna always send invite logs, even if we're not monitoring them
|
||||
isInv = false
|
||||
invites = 0;
|
||||
const channel = client.channels.cache.get(config.discord.invitelog)
|
||||
let guild = member.guild
|
||||
member.guild.invites.fetch().then(async guildInvites => { //get all guild invites
|
||||
await (async () => {
|
||||
guildInvites.forEach(invite => { //basically a for loop over the invites
|
||||
|
||||
if (invite.uses != client.invites[invite.code]) { //if it doesn't match what we stored:
|
||||
channel.send({
|
||||
embeds: [{
|
||||
|
@ -415,11 +413,9 @@ client.on('guildMemberAdd', async (member) => { // We're just gonna always send
|
|||
}]
|
||||
});
|
||||
client.invites[invite.code] = invite.uses
|
||||
isInv = true
|
||||
}
|
||||
})
|
||||
})();
|
||||
if (isInv) return;
|
||||
invites++
|
||||
} else if (invites == guildInvites.toJSON().length()) {
|
||||
// Assume its a custom link lol
|
||||
channel.send({
|
||||
embeds: [{
|
||||
color: 0x00ff00,
|
||||
|
@ -440,6 +436,8 @@ client.on('guildMemberAdd', async (member) => { // We're just gonna always send
|
|||
]
|
||||
}]
|
||||
});
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
if (defcon <= 3) {
|
||||
|
|
Loading…
Reference in a new issue