This commit is contained in:
Christopher Cookman 2024-04-15 01:06:04 -06:00
parent ae667d18e7
commit b9fa194933
Signed by: ChrisChrome
GPG key ID: A023A26E42C33A42

View file

@ -250,9 +250,9 @@ client.on("ready", async () => {
client.invites[guildInvite.code] = guildInvite.uses client.invites[guildInvite.code] = guildInvite.uses
}) })
}) })
if(guild.vanityURLCode) { guild.fetchVanityData().then(vanityData => {
client.invites[guild.vanityURLCode] = guild.vanityURLUses client.invites[vanityData.code] = vanityData.uses
} })
}) })
const commands = [ const commands = [
@ -417,8 +417,8 @@ client.on('guildMemberAdd', async (member) => { // We're just gonna always send
}) })
}) })
// Handle vanity URLs // Handle vanity URLs
console.log(`Checking vanity: ${member.guild.vanityURLUses != client.invites[member.guild.vanityURLCode]} ${member.guild.vanityURLCode} ${member.guild.vanityURLUses}`) member.guild.fetchVanityData().then(vanityData => {
if (member.guild.vanityURLUses != client.invites[member.guild.vanityURLCode]) { // They used the vanity URL if (vanityData.uses != client.invites[vanityData.code]) { // They used the vanity URL
channel.send({ channel.send({
embeds: [{ embeds: [{
color: 0x00ff00, color: 0x00ff00,
@ -430,7 +430,7 @@ client.on('guildMemberAdd', async (member) => { // We're just gonna always send
}, },
{ {
name: "Invite", name: "Invite",
value: `Vanity Code: ${member.guild.vanityURLCode}\nUses: ${member.vanityURLUses}` value: `Vanity Code: ${vanityData.code}\nUses: ${vanityData.uses}`
}, },
{ {
name: "Guild", name: "Guild",
@ -440,6 +440,8 @@ 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