TEST
This commit is contained in:
parent
ae667d18e7
commit
b9fa194933
14
index.js
14
index.js
|
@ -250,9 +250,9 @@ client.on("ready", async () => {
|
|||
client.invites[guildInvite.code] = guildInvite.uses
|
||||
})
|
||||
})
|
||||
if(guild.vanityURLCode) {
|
||||
client.invites[guild.vanityURLCode] = guild.vanityURLUses
|
||||
}
|
||||
guild.fetchVanityData().then(vanityData => {
|
||||
client.invites[vanityData.code] = vanityData.uses
|
||||
})
|
||||
})
|
||||
|
||||
const commands = [
|
||||
|
@ -417,8 +417,8 @@ client.on('guildMemberAdd', async (member) => { // We're just gonna always send
|
|||
})
|
||||
})
|
||||
// Handle vanity URLs
|
||||
console.log(`Checking vanity: ${member.guild.vanityURLUses != client.invites[member.guild.vanityURLCode]} ${member.guild.vanityURLCode} ${member.guild.vanityURLUses}`)
|
||||
if (member.guild.vanityURLUses != client.invites[member.guild.vanityURLCode]) { // They used the vanity URL
|
||||
member.guild.fetchVanityData().then(vanityData => {
|
||||
if (vanityData.uses != client.invites[vanityData.code]) { // They used the vanity URL
|
||||
channel.send({
|
||||
embeds: [{
|
||||
color: 0x00ff00,
|
||||
|
@ -430,7 +430,7 @@ client.on('guildMemberAdd', async (member) => { // We're just gonna always send
|
|||
},
|
||||
{
|
||||
name: "Invite",
|
||||
value: `Vanity Code: ${member.guild.vanityURLCode}\nUses: ${member.vanityURLUses}`
|
||||
value: `Vanity Code: ${vanityData.code}\nUses: ${vanityData.uses}`
|
||||
},
|
||||
{
|
||||
name: "Guild",
|
||||
|
@ -440,6 +440,8 @@ client.on('guildMemberAdd', async (member) => { // We're just gonna always send
|
|||
}]
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
if (defcon <= 3) {
|
||||
// DM user saying Invites are disabled for security reasons, then kick them with the same reason
|
||||
|
|
Loading…
Reference in a new issue