From e333b23bb4a90276217002e6ae36350244c8ccf8 Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Sat, 13 Mar 2021 16:42:19 -0700 Subject: [PATCH] n?ut cleanup + guildDelete logs --- commands/misc/uptime.js | 1 - events/guildDelete.js | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 events/guildDelete.js diff --git a/commands/misc/uptime.js b/commands/misc/uptime.js index 63e8b7c..1a164de 100644 --- a/commands/misc/uptime.js +++ b/commands/misc/uptime.js @@ -19,7 +19,6 @@ module.exports = { const bot = await Bot.findOne({finder: 'lel'}); return message.channel.send(new Discord.MessageEmbed() .setTitle("Uptime") - .setThumbnail(client.user.avatarURL({size: 2048})) .setDescription(moment.preciseDiff(moment(bot.lastRestart), moment())) .setColor('c375f0') .setFooter("Natsuki") diff --git a/events/guildDelete.js b/events/guildDelete.js new file mode 100644 index 0000000..810d2a5 --- /dev/null +++ b/events/guildDelete.js @@ -0,0 +1,28 @@ +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('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('Natsuki') + .setTimestamp() + ); +}; \ No newline at end of file