Ok
This commit is contained in:
parent
7e4e7f97b5
commit
6bc181f87d
5
index.js
5
index.js
|
@ -385,6 +385,7 @@ client.on('guildMemberAdd', async (member) => { // We're just gonna always send
|
||||||
const channel = client.channels.cache.get(config.discord.invitelog)
|
const channel = client.channels.cache.get(config.discord.invitelog)
|
||||||
let guild = member.guild
|
let guild = member.guild
|
||||||
member.guild.invites.fetch().then(guildInvites => { //get all guild invites
|
member.guild.invites.fetch().then(guildInvites => { //get all guild invites
|
||||||
|
await (async () => {
|
||||||
guildInvites.forEach(invite => { //basically a for loop over the invites
|
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:
|
if (invite.uses != client.invites[invite.code]) { //if it doesn't match what we stored:
|
||||||
|
@ -410,6 +411,9 @@ client.on('guildMemberAdd', async (member) => { // We're just gonna always send
|
||||||
});
|
});
|
||||||
return client.invites[invite.code] = invite.uses
|
return client.invites[invite.code] = invite.uses
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
})();
|
||||||
|
|
||||||
channel.send({
|
channel.send({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
color: 0x00ff00,
|
color: 0x00ff00,
|
||||||
|
@ -431,7 +435,6 @@ client.on('guildMemberAdd', async (member) => { // We're just gonna always send
|
||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
})
|
|
||||||
|
|
||||||
if (defcon <= 3) {
|
if (defcon <= 3) {
|
||||||
// DM user saying Invites are disabled for security reasons, then kick them with the same reason
|
// DM user saying Invites are disabled for security reasons, then kick them with the same reason
|
||||||
|
|
Loading…
Reference in a new issue