From 59524119cc99c84e99d7ba5adddb6fcb773571e1 Mon Sep 17 00:00:00 2001 From: AnxietyisReal <96593068+AnxietyisReal@users.noreply.github.com> Date: Sun, 22 Jan 2023 16:00:20 +1100 Subject: [PATCH] Tidy up commented out code. --- src/events/guildMemberAdd.ts | 1 - src/events/guildMemberRemove.ts | 1 - src/events/guildMemberUpdate.ts | 5 +---- src/events/messageCreate.ts | 1 - src/events/messageDelete.ts | 3 --- src/events/messageUpdate.ts | 6 ------ 6 files changed, 1 insertion(+), 16 deletions(-) diff --git a/src/events/guildMemberAdd.ts b/src/events/guildMemberAdd.ts index 322fc51..d9588f6 100644 --- a/src/events/guildMemberAdd.ts +++ b/src/events/guildMemberAdd.ts @@ -2,7 +2,6 @@ import Discord from 'discord.js'; import { TClient } from '../client'; export default { async run(client:TClient, member:Discord.GuildMember){ - //if (member.partial) return; if ( member.partial || member.guild?.id != client.config.mainServer.id diff --git a/src/events/guildMemberRemove.ts b/src/events/guildMemberRemove.ts index 5d99b36..4b21879 100644 --- a/src/events/guildMemberRemove.ts +++ b/src/events/guildMemberRemove.ts @@ -7,7 +7,6 @@ export default { !member.joinedTimestamp || member.guild?.id != client.config.mainServer.id ) return; - // if (member.guild?.id != client.config.mainServer.id) return; const embed = new client.embed().setColor(client.config.embedColorRed).setTimestamp().setThumbnail(member.user.displayAvatarURL({size: 2048}) as string).setTitle(`Member Left: ${member.user.tag}`).setDescription(`<@${member.user.id}>\n\`${member.user.id}\``).addFields( {name: '🔹 Account Creation Date', value: `\n`}, {name: '🔹 Server Join Date', value: `\n`}, diff --git a/src/events/guildMemberUpdate.ts b/src/events/guildMemberUpdate.ts index 9e60243..73c9423 100644 --- a/src/events/guildMemberUpdate.ts +++ b/src/events/guildMemberUpdate.ts @@ -6,10 +6,7 @@ export default { if (!client.config.botSwitches.logs) return; const channel = (client.channels.resolve(client.config.mainServer.channels.logs) as Discord.TextChannel) if (oldMember.nickname != newMember.nickname){ - const embed = new client.embed().setColor(client.config.embedColor).setTimestamp().setThumbnail(newMember.user.displayAvatarURL({size: 2048})).setTitle(`Nickname updated: ${newMember.user.tag}`).setDescription(`<@${newMember.user.id}>\n\`${newMember.user.id}\``)/*.addFields( - {name: '🔹 Old nickname', value: oldMember.nickname == null ? 'No nickname' : `\`\`\`${oldMember.nickname}\`\`\``}, - {name: '🔹 New nickname', value: newMember.nickname == null ? 'No nickname' : `\`\`\`${newMember.nickname}\`\`\``} - );*/ + const embed = new client.embed().setColor(client.config.embedColor).setTimestamp().setThumbnail(newMember.user.displayAvatarURL({size: 2048})).setTitle(`Nickname updated: ${newMember.user.tag}`).setDescription(`<@${newMember.user.id}>\n\`${newMember.user.id}\``) oldMember.nickname == null ? '' : embed.addFields({name: '🔹 Old nickname', value: `\`\`\`${oldMember.nickname}\`\`\``}) newMember.nickname == null ? '' : embed.addFields({name: '🔹 New nickname', value: `\`\`\`${newMember.nickname}\`\`\``}) channel.send({embeds: [embed]}) diff --git a/src/events/messageCreate.ts b/src/events/messageCreate.ts index 5d97e7c..642e247 100644 --- a/src/events/messageCreate.ts +++ b/src/events/messageCreate.ts @@ -6,7 +6,6 @@ export default { message.author.bot || message.channel.type === ChannelType.DM ) return; - // if (message.channel.type === ChannelType.DM) return; const msgarr = message.content.toLowerCase().split(' '); let automodded: boolean; diff --git a/src/events/messageDelete.ts b/src/events/messageDelete.ts index 485c965..5f260f4 100644 --- a/src/events/messageDelete.ts +++ b/src/events/messageDelete.ts @@ -13,9 +13,6 @@ export default { || msg.author.bot || disabledChannels.includes(msg.channelId) ) return; - // if (msg.partial) return; - // if (msg.author.bot) return; - // if (disabledChannels.includes(msg.channelId)) return; const embed = new client.embed().setColor(client.config.embedColorRed).setTimestamp().setAuthor({name: `Author: ${msg.author.tag} (${msg.author.id})`, iconURL: `${msg.author.displayAvatarURL()}`}).setTitle('Message deleted').setDescription(`<@${msg.author.id}>\n\`${msg.author.id}\``); if (msg.content.length != 0) embed.addFields({name: 'Content', value: `\`\`\`\n${msg.content.slice(0,1000)}\n\`\`\``}); embed.addFields( diff --git a/src/events/messageUpdate.ts b/src/events/messageUpdate.ts index 19a58b7..a7c88d8 100644 --- a/src/events/messageUpdate.ts +++ b/src/events/messageUpdate.ts @@ -15,12 +15,6 @@ export default { || !newMsg.member || disabledChannels.includes(newMsg.channelId) ) return; - // if (oldMsg.author == null) return; - // if (oldMsg?.author.bot) return; - // if (oldMsg.partial) return; - // if (newMsg.partial) return; - // if (!newMsg.member) return; - // if (disabledChannels.includes(newMsg.channelId)) return; const msgarr = newMsg.content.toLowerCase().split(' '); if (client.bannedWords._content.some((word:string)=>msgarr.includes(word)) && (!client.isStaff(newMsg.member))) newMsg.delete(); if (newMsg.content === oldMsg.content) return;