Merge events-cleanup into master; begin events cleanup

Reviewed-on: http://git.wubzy.xyz/Luno/Luno/pulls/1
master
Kit Kasune 4 years ago
commit 84103d4a9c
  1. 28
      events/guildCreate.js
  2. 27
      events/guildDelete.js
  3. 25
      events/guildMemberRemove.js

@ -1,28 +0,0 @@
const Discord = require('discord.js');
const BotDataSchema = require('../models/bot');
module.exports = async (client, guild) => {
/*
* Top.gg API
* GBL API never happening
* Other APIs idk
*/
let botData = await BotDataSchema.findOne({finder: 'lel'});
botData.servers = client.guilds.cache.size;
botData.servers_all += 1;
botData.save();
client.guilds.cache.get('762707532417335296').channels.cache.get('766031709866557471').send(new Discord.MessageEmbed()
.setAuthor('New Guild Added', client.users.cache.get(guild.owner.id).avatarURL())
.setTitle(guild.name)
.setThumbnail(guild.iconURL({size: 2048}))
.addField('Owner', client.users.cache.get(guild.owner.id).tag, true)
.addField('Members', guild.members.cache.size, true)
.addField('Position', `Server #${client.guilds.cache.size}`, true)
.setColor('55ff7f')
.setFooter('Luno')
.setTimestamp()
);
};

@ -1,27 +0,0 @@
const Discord = require('discord.js');
const BotDataSchema = require('../models/bot');
module.exports = async (client, guild) => {
/*
* Top.gg API
* GBL API never happening
* Other APIs idk
*/
let botData = await BotDataSchema.findOne({finder: 'lel'});
botData.servers = client.guilds.cache.size;
botData.save();
client.guilds.cache.get('762707532417335296').channels.cache.get('766031709866557471').send(new Discord.MessageEmbed()
.setAuthor('Server Lost', client.users.cache.get(guild.owner.id).avatarURL())
.setTitle(guild.name)
.setThumbnail(guild.iconURL({size: 2048}))
.addField('Owner', client.users.cache.get(guild.owner.id).tag, true)
.addField('Members', guild.members.cache.size, true)
.addField('Position', `Server #${client.guilds.cache.size + 1}`, true)
.setColor('ff5d6a')
.setFooter('Luno')
.setTimestamp()
);
};

@ -13,4 +13,29 @@ module.exports = async (client, member) => {
) { ) {
try {member.guild.channels.cache.get(tg.lch).send(await sendResponse(member, member.guild.channels.cache.get(tg.lch), 'xdlol', client, tr.responses.get(tr.bindings.get('leave'))));} catch {} try {member.guild.channels.cache.get(tg.lch).send(await sendResponse(member, member.guild.channels.cache.get(tg.lch), 'xdlol', client, tr.responses.get(tr.bindings.get('leave'))));} catch {}
} }
let cm = Mute.findOne({uid: member.id});
if (cm) {
member.guild.members.ban(member.id)
.then(() => message.guild.channels.cache.get('830600344668602409').send("<@&828000073203974166>", new Discord.MessageEmbed()
.setAuthor(member.displayName, client.users.cache.get(member.id).avatarURL())
.setTitle("Mute Evasion Detected!")
.setDescription(`<@${member.id}> has evaded their mute, and I've automatically banned them!`)
.addField("Original Mod", `<@${cm.id}>`)
.setColor('c77dff')
.setFooter("Kit", client.user.avatarURL())
.setTimestamp()
)).catch(e => {
console.error(`\n${chalk.red('[ERROR]')} >> ${chalk.yellow(`At [${date}] | Occurred while trying to ban a member for mute evasion`)}`, e);
message.guild.channels.cache.get('830600344668602409').send("<@&828000073203974166> **Failed automatic mute evasion ban!**", new Discord.MessageEmbed()
.setAuthor(member.displayName, client.users.cache.get(member.id).avatarURL())
.setTitle("Mute Evasion Detected!")
.setDescription(`<@${member.id}> has evaded their mute, but I was not able to automatically ban them! Their user ID is \`${member.id}\`.`)
.addField("Original Mod", `<@${cm.id}>`)
.setColor('c77dff')
.setFooter("Kit", client.user.avatarURL())
.setTimestamp()
);
});
}
}; };
Loading…
Cancel
Save