Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Tagliatelle authored Jun 20, 2021
1 parent 4e83fa9 commit 7464ce9
Show file tree
Hide file tree
Showing 49 changed files with 10,447 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Collection/premiumServers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const { Collection } = require("discord.js");

const prems = new Collection();
const prem = require("../models/premium");

function loadPrems(client) {
client.guilds.cache.forEach((guild) => {
prem.findOne({ Guild: guild.id }, async (err, data) => {
if (data) {
prems.set(guild.id, true);
}
});
});
}

module.exports = {
prems,
loadPrems,
};
23 changes: 23 additions & 0 deletions events/afk.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const client = require('../index')
const db = require('quick.db')
const ms = require('ms')

client.on('message', async(message) => {
if(!message.guild) return;
if(message.author.bot) return;
//message get afk person
if(db.has(`afk-${message.author.id}+${message.guild.id}`)) {
await db.delete(`afk-${message.author.id}+${message.guild.id}`)
message.reply(`I have removed your AFK!`)
}
//get mentioned afk
if(message.mentions.members.first()) {
const info = db.get(`afk-${message.mentions.members.first().id}+${message.guild.id}`)
if(db.has(`afk-${message.mentions.members.first().id}+${message.guild.id}`)) {
message.reply(`**${message.mentions.members.first().user.username}** is AFK for: **${info}**`)
} else return;
}else;



})
88 changes: 88 additions & 0 deletions events/anti-alt.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
const client = require('../index')
const altSchema = require('../models/alt')
const altlog = require('../models/alt-logs')
const { MessageEmbed } = require('discord.js')
const moment = require('moment')

client.on('guildMemberAdd', async(member) => {
altSchema.findOne({ Guild: member.guild.id}, async(err, data) => {
if(!data) return;
if(data.Avatar == true) {
if(member.user.avatar == null) {
await member.send(new MessageEmbed()
.setTitle(`CoreX Alt Identifier`)
.setDescription(`You were kicked from **${member.guild.name}** | **This account is suspected of being an alt**`)
.setColor("RED")
.setTimestamp()
).catch(err => {
member.kick('This account is suspected of being an alt')
})
await member.kick('This account is suspected of being an alt')
}
}

if(data.Days == '0') return;
let x = Date.now() - member.user.createdAt;
let created = Math.floor(x / 86400000);
let AltAge = data.Days
if(created >= AltAge) return;
if(created < AltAge) {
await member.send(new MessageEmbed()
.setTitle(`CoreX Alt identifier`)
.setDescription(`You were kicked from **${member.guild.name}** | **The Age Of This Account Is Below Age Requirements**`)
.setColor("RED")
.setTimestamp()
).catch(err => {
member.kick(`The Age Of This Account Is Below Age Requirements`)
})
await member.kick(`The Age Of This Account Is Below Age Requirements`)
}
})

await altlog.findOne({ Guild: member.guild.id }, async(err,data1) => {
if(!data1) return;
const channel = await member.guild.channels.cache.get(data1.Channel)
const embed = new MessageEmbed()
.setTitle(`CoreX Alt Identifier`)
.setDescription(`**:Caution: New Alt Found**`)
.addField(`General Information`, [
`Name: ${member.user.username}`,
`Discriminator: ${member.user.discriminator}`
])
.addField(`Additional Information`, [
`Bot: ${member.user.bot}`,
`Created: ${moment(member.user.createdTimestamp).format(
"LT"
)} ${moment(member.user.createdTimestamp).format(
"LL"
)} ${moment(member.user.createdTimestamp).fromNow()}`,
`Joined: ${moment(member.joinedTimestamp).format(
"LT"
)} ${moment(member.joinedTimestamp).format(
"LL"
)} ${moment(member.joinedTimestamp).fromNow()}`,
`Avatar: ${member.user.avatar || `No Avatar`}`,
])
.setThumbnail(member.user.displayAvatarURL({dynamic: true}))
.setColor("RED")
.setFooter(`Kicked That Alt`)
channel.send(embed)
})
})


client.on('guildDelete', async(guild) => {
altlog.findOne({ Guild: guild.id }, async (err, data) => {
if (err) throw err;
if (data) {
altlog.findOneAndDelete({ Guild : guild.id }).then(console.log('deleted data.'))
}
})

altSchema.findOne({ Guild: guild.id}, async(err, data) => {
if (err) throw err;
if (data) {
altSchema.findOneAndDelete({ Guild : guild.id }).then(console.log('deleted data.'))
}
})
})
28 changes: 28 additions & 0 deletions events/anti-raidmode.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const client = require('../index')
const schema = require('../models/raidmode');
const { MessageEmbed } = require('discord.js')
const moment = require('moment')

client.on('guildMemberAdd', async(member) => {
schema.findOne({ Guild: member.guild.id }, async (err, data) => {
const kickReason = 'Anti-raidmode activated';
if (!data) return;
if (data) {
try {
member.send(
new MessageEmbed()
.setTitle(`Server Under Lockdown`)
.setDescription(
`You have been kicked from **${
member.guild.name
}** with reason: **${kickReason}**`
)
.setColor('RED')
);
} catch(e){
throw e
}
member.kick(kickReason);
}
});
})
Loading

0 comments on commit 7464ce9

Please sign in to comment.