diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-12-29 22:14:04 -0500 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-12-29 22:14:04 -0500 |
commit | f0a9f894575871d498447c5de2b5f0f826b117b7 (patch) | |
tree | e3dc03b24ef7197699bc74ad47ebcbdc9cb19c1b /src/listeners/custom | |
parent | 1182f63498c856111762e2766d6cdddf063f2a97 (diff) | |
download | tanzanite-f0a9f894575871d498447c5de2b5f0f826b117b7.tar.gz tanzanite-f0a9f894575871d498447c5de2b5f0f826b117b7.tar.bz2 tanzanite-f0a9f894575871d498447c5de2b5f0f826b117b7.zip |
events
Diffstat (limited to 'src/listeners/custom')
-rw-r--r-- | src/listeners/custom/bushBan.ts | 32 | ||||
-rw-r--r-- | src/listeners/custom/bushKick.ts | 31 | ||||
-rw-r--r-- | src/listeners/custom/bushLevelUpdate.ts | 28 | ||||
-rw-r--r-- | src/listeners/custom/bushMute.ts | 32 | ||||
-rw-r--r-- | src/listeners/custom/bushPunishRole.ts | 31 | ||||
-rw-r--r-- | src/listeners/custom/bushPunishRoleRemove.ts | 32 | ||||
-rw-r--r-- | src/listeners/custom/bushPurge.ts | 40 | ||||
-rw-r--r-- | src/listeners/custom/bushUnban.ts | 31 | ||||
-rw-r--r-- | src/listeners/custom/bushUnmute.ts | 31 | ||||
-rw-r--r-- | src/listeners/custom/bushUpdateModlog.ts | 33 | ||||
-rw-r--r-- | src/listeners/custom/bushUpdateSettings.ts | 33 | ||||
-rw-r--r-- | src/listeners/custom/bushWarn.ts | 31 |
12 files changed, 0 insertions, 385 deletions
diff --git a/src/listeners/custom/bushBan.ts b/src/listeners/custom/bushBan.ts deleted file mode 100644 index 59e010e..0000000 --- a/src/listeners/custom/bushBan.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { BushListener, type BushClientEvents } from '#lib'; -import { GuildMember, MessageEmbed } from 'discord.js'; - -export default class BushBanListener extends BushListener { - public constructor() { - super('bushBan', { - emitter: 'client', - event: 'bushBan', - category: 'custom' - }); - } - - public override async exec(...[victim, moderator, guild, reason, caseID, duration, dmSuccess]: BushClientEvents['bushBan']) { - const logChannel = await guild.getLogChannel('moderation'); - if (!logChannel) return; - const user = victim instanceof GuildMember ? victim.user : victim; - - const logEmbed = new MessageEmbed() - .setColor(util.colors.discord.RED) - .setTimestamp() - .setFooter({ text: `CaseID: ${caseID}` }) - .setAuthor({ name: user.tag, iconURL: user.avatarURL({ dynamic: true, format: 'png', size: 4096 }) ?? undefined }) - .addField('**Action**', `${duration ? 'Temp Ban' : 'Perm Ban'}`) - .addField('**User**', `${user} (${user.tag})`) - .addField('**Moderator**', `${moderator} (${moderator.tag})`) - // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing - .addField('**Reason**', `${reason || '[No Reason Provided]'}`); - if (duration) logEmbed.addField('**Duration**', util.humanizeDuration(duration)); - if (dmSuccess === false) logEmbed.addField('**Additional Info**', 'Could not dm user.'); - return await logChannel.send({ embeds: [logEmbed] }); - } -} diff --git a/src/listeners/custom/bushKick.ts b/src/listeners/custom/bushKick.ts deleted file mode 100644 index 866aba4..0000000 --- a/src/listeners/custom/bushKick.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { BushListener, type BushClientEvents } from '#lib'; -import { GuildMember, MessageEmbed } from 'discord.js'; - -export default class BushKickListener extends BushListener { - public constructor() { - super('bushKick', { - emitter: 'client', - event: 'bushKick', - category: 'custom' - }); - } - - public override async exec(...[victim, moderator, guild, reason, caseID, dmSuccess]: BushClientEvents['bushKick']) { - const logChannel = await guild.getLogChannel('moderation'); - if (!logChannel) return; - const user = victim instanceof GuildMember ? victim.user : victim; - - const logEmbed = new MessageEmbed() - .setColor(util.colors.discord.RED) - .setTimestamp() - .setFooter({ text: `CaseID: ${caseID}` }) - .setAuthor({ name: user.tag, iconURL: user.avatarURL({ dynamic: true, format: 'png', size: 4096 }) ?? undefined }) - .addField('**Action**', `${'Kick'}`) - .addField('**User**', `${user} (${user.tag})`) - .addField('**Moderator**', `${moderator} (${moderator.tag})`) - // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing - .addField('**Reason**', `${reason || '[No Reason Provided]'}`); - if (dmSuccess === false) logEmbed.addField('**Additional Info**', 'Could not dm user.'); - return await logChannel.send({ embeds: [logEmbed] }); - } -} diff --git a/src/listeners/custom/bushLevelUpdate.ts b/src/listeners/custom/bushLevelUpdate.ts deleted file mode 100644 index 4504c45..0000000 --- a/src/listeners/custom/bushLevelUpdate.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { BushListener, type BushClientEvents } from '#lib'; -import { type TextChannel } from 'discord.js'; - -export default class BushLevelUpdateListener extends BushListener { - public constructor() { - super('bushLevelUpdate', { - emitter: 'client', - event: 'bushLevelUpdate', - category: 'custom' - }); - } - - public override async exec(...[member, _oldLevel, newLevel, _currentXp, message]: BushClientEvents['bushLevelUpdate']) { - if (await message.guild.hasFeature('sendLevelUpMessages')) { - void (async () => { - const channel = ((await message.guild.channels - .fetch((await message.guild.getSetting('levelUpChannel')) ?? message.channelId) - .catch(() => null)) ?? message.channel) as TextChannel; - - const success = await channel - .send(`${util.format.input(member.user.tag)} leveled up to level ${util.format.input(`${newLevel}`)}.`) - .catch(() => null); - - if (!success) await client.console.warn('bushLevelUpdate', `Could not send level up message in ${message.guild}`); - })(); - } - } -} diff --git a/src/listeners/custom/bushMute.ts b/src/listeners/custom/bushMute.ts deleted file mode 100644 index c25bd69..0000000 --- a/src/listeners/custom/bushMute.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { BushListener, type BushClientEvents } from '#lib'; -import { GuildMember, MessageEmbed } from 'discord.js'; - -export default class BushMuteListener extends BushListener { - public constructor() { - super('bushMute', { - emitter: 'client', - event: 'bushMute', - category: 'custom' - }); - } - - public override async exec(...[victim, moderator, guild, reason, caseID, duration, dmSuccess]: BushClientEvents['bushMute']) { - const logChannel = await guild.getLogChannel('moderation'); - if (!logChannel) return; - const user = victim instanceof GuildMember ? victim.user : victim; - - const logEmbed = new MessageEmbed() - .setColor(util.colors.discord.ORANGE) - .setTimestamp() - .setFooter({ text: `CaseID: ${caseID}` }) - .setAuthor({ name: user.tag, iconURL: user.avatarURL({ dynamic: true, format: 'png', size: 4096 }) ?? undefined }) - .addField('**Action**', `${duration ? 'Temp Mute' : 'Perm Mute'}`) - .addField('**User**', `${user} (${user.tag})`) - .addField('**Moderator**', `${moderator} (${moderator.tag})`) - // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing - .addField('**Reason**', `${reason || '[No Reason Provided]'}`); - if (duration) logEmbed.addField('**Duration**', `${util.humanizeDuration(duration) || duration}`); - if (dmSuccess === false) logEmbed.addField('**Additional Info**', 'Could not dm user.'); - return await logChannel.send({ embeds: [logEmbed] }); - } -} diff --git a/src/listeners/custom/bushPunishRole.ts b/src/listeners/custom/bushPunishRole.ts deleted file mode 100644 index 3491166..0000000 --- a/src/listeners/custom/bushPunishRole.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { BushListener, type BushClientEvents } from '#lib'; -import { GuildMember, MessageEmbed } from 'discord.js'; - -export default class BushPunishRoleListener extends BushListener { - public constructor() { - super('bushPunishRole', { - emitter: 'client', - event: 'bushPunishRole', - category: 'custom' - }); - } - - public override async exec(...[victim, moderator, guild, reason, caseID, duration]: BushClientEvents['bushPunishRole']) { - const logChannel = await guild.getLogChannel('moderation'); - if (!logChannel) return; - const user = victim instanceof GuildMember ? victim.user : victim; - - const logEmbed = new MessageEmbed() - .setColor(util.colors.discord.YELLOW) - .setTimestamp() - .setFooter({ text: `CaseID: ${caseID}` }) - .setAuthor({ name: user.tag, iconURL: user.avatarURL({ dynamic: true, format: 'png', size: 4096 }) ?? undefined }) - .addField('**Action**', `${duration ? 'Temp Punishment Role' : 'Perm Punishment Role'}`) - .addField('**User**', `${user} (${user.tag})`) - .addField('**Moderator**', `${moderator} (${moderator.tag})`) - // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing - .addField('**Reason**', `${reason || '[No Reason Provided]'}`); - if (duration) logEmbed.addField('**Duration**', util.humanizeDuration(duration)); - return await logChannel.send({ embeds: [logEmbed] }); - } -} diff --git a/src/listeners/custom/bushPunishRoleRemove.ts b/src/listeners/custom/bushPunishRoleRemove.ts deleted file mode 100644 index eb1ae71..0000000 --- a/src/listeners/custom/bushPunishRoleRemove.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { BushListener, type BushClientEvents } from '#lib'; -import { GuildMember, MessageEmbed } from 'discord.js'; - -export default class BushPunishRoleRemoveListener extends BushListener { - public constructor() { - super('bushPunishRoleRemove', { - emitter: 'client', - event: 'bushPunishRoleRemove', - category: 'custom' - }); - } - - public override async exec(...[victim, moderator, guild, reason, caseID, role]: BushClientEvents['bushPunishRoleRemove']) { - const logChannel = await guild.getLogChannel('moderation'); - if (!logChannel) return; - const user = victim instanceof GuildMember ? victim.user : victim; - - const logEmbed = new MessageEmbed() - .setColor(util.colors.discord.GREEN) - .setTimestamp() - .setFooter({ text: `CaseID: ${caseID}` }) - .setAuthor({ name: user.tag, iconURL: user.avatarURL({ dynamic: true, format: 'png', size: 4096 }) ?? undefined }) - .addField('**Action**', `${'Remove Punishment Role'}`) - .addField('**Role**', `${role}`) - .addField('**User**', `${user} (${user.tag})`) - .addField('**Moderator**', `${moderator} (${moderator.tag})`) - // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing - .addField('**Reason**', `${reason || '[No Reason Provided]'}`); - - return await logChannel.send({ embeds: [logEmbed] }); - } -} diff --git a/src/listeners/custom/bushPurge.ts b/src/listeners/custom/bushPurge.ts deleted file mode 100644 index 97824a4..0000000 --- a/src/listeners/custom/bushPurge.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { BushListener, type BushClientEvents } from '#lib'; -import { MessageEmbed } from 'discord.js'; - -export default class BushPurgeListener extends BushListener { - public constructor() { - super('bushPurge', { - emitter: 'client', - event: 'bushPurge', - category: 'custom' - }); - } - - public override async exec(...[moderator, guild, channel, messages]: BushClientEvents['bushPurge']) { - const logChannel = await guild.getLogChannel('moderation'); - if (!logChannel) return; - - const mappedMessages = messages.map((m) => ({ - id: m.id, - author: `${m.author.tag} (${m.id})`, - content: m.content, - embeds: m.embeds, - attachments: [...m.attachments.values()] - })); - const haste = await util.inspectCleanRedactHaste(mappedMessages); - - const logEmbed = new MessageEmbed() - .setColor(util.colors.discord.DARK_PURPLE) - .setTimestamp() - .setFooter({ text: `${messages.size.toLocaleString()} Messages` }) - .setAuthor({ name: moderator.tag, iconURL: moderator.avatarURL({ dynamic: true, format: 'png', size: 4096 }) ?? undefined }) - .addField('**Action**', `${'Purge'}`) - .addField('**Moderator**', `${moderator} (${moderator.tag})`) - .addField('**Channel**', `<#${channel.id}> (${channel.name})`) - .addField( - '**Messages**', - `${haste.url ? `[haste](${haste.url})${haste.error ? `- ${haste.error}` : ''}` : `${util.emojis.error} ${haste.error}`}` - ); - return await logChannel.send({ embeds: [logEmbed] }); - } -} diff --git a/src/listeners/custom/bushUnban.ts b/src/listeners/custom/bushUnban.ts deleted file mode 100644 index a59bcf0..0000000 --- a/src/listeners/custom/bushUnban.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { BushListener, type BushClientEvents } from '#lib'; -import { GuildMember, MessageEmbed } from 'discord.js'; - -export default class BushUnbanListener extends BushListener { - public constructor() { - super('bushUnban', { - emitter: 'client', - event: 'bushUnban', - category: 'custom' - }); - } - - public override async exec(...[victim, moderator, guild, reason, caseID, dmSuccess]: BushClientEvents['bushUnban']) { - const logChannel = await guild.getLogChannel('moderation'); - if (!logChannel) return; - const user = victim instanceof GuildMember ? victim.user : victim; - - const logEmbed = new MessageEmbed() - .setColor(util.colors.discord.GREEN) - .setTimestamp() - .setFooter({ text: `CaseID: ${caseID}` }) - .setAuthor({ name: user.tag, iconURL: user.avatarURL({ dynamic: true, format: 'png', size: 4096 }) ?? undefined }) - .addField('**Action**', `${'Unban'}`) - .addField('**User**', `${user} (${user.tag})`) - .addField('**Moderator**', `${moderator} (${moderator.tag})`) - // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing - .addField('**Reason**', `${reason || '[No Reason Provided]'}`); - if (dmSuccess === false) logEmbed.addField('**Additional Info**', 'Could not dm user.'); - return await logChannel.send({ embeds: [logEmbed] }); - } -} diff --git a/src/listeners/custom/bushUnmute.ts b/src/listeners/custom/bushUnmute.ts deleted file mode 100644 index bd14fcd..0000000 --- a/src/listeners/custom/bushUnmute.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { BushListener, type BushClientEvents } from '#lib'; -import { GuildMember, MessageEmbed } from 'discord.js'; - -export default class BushUnmuteListener extends BushListener { - public constructor() { - super('bushUnmute', { - emitter: 'client', - event: 'bushUnmute', - category: 'custom' - }); - } - - public override async exec(...[victim, moderator, guild, reason, caseID, dmSuccess]: BushClientEvents['bushUnmute']) { - const logChannel = await guild.getLogChannel('moderation'); - if (!logChannel) return; - const user = victim instanceof GuildMember ? victim.user : victim; - - const logEmbed = new MessageEmbed() - .setColor(util.colors.discord.GREEN) - .setTimestamp() - .setFooter({ text: `CaseID: ${caseID}` }) - .setAuthor({ name: user.tag, iconURL: user.avatarURL({ dynamic: true, format: 'png', size: 4096 }) ?? undefined }) - .addField('**Action**', `${'Unmute'}`) - .addField('**User**', `${user} (${user.tag})`) - .addField('**Moderator**', `${moderator} (${moderator.tag})`) - // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing - .addField('**Reason**', `${reason || '[No Reason Provided]'}`); - if (dmSuccess === false) logEmbed.addField('**Additional Info**', 'Could not dm user.'); - return await logChannel.send({ embeds: [logEmbed] }); - } -} diff --git a/src/listeners/custom/bushUpdateModlog.ts b/src/listeners/custom/bushUpdateModlog.ts deleted file mode 100644 index fa82dba..0000000 --- a/src/listeners/custom/bushUpdateModlog.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { BushListener, type BushClientEvents } from '#lib'; -import { MessageEmbed } from 'discord.js'; - -export default class BushUpdateModlogListener extends BushListener { - public constructor() { - super('bushUpdateModlog', { - emitter: 'client', - event: 'bushUpdateModlog', - category: 'custom' - }); - } - - public override async exec(...[moderator, modlogID, key, oldModlog, newModlog]: BushClientEvents['bushUpdateModlog']) { - const logChannel = await moderator.guild.getLogChannel('moderation'); - if (!logChannel) return; - - const logEmbed = new MessageEmbed() - .setColor(util.colors.discord.BLURPLE) - .setTimestamp() - .setAuthor({ - name: moderator.user.tag, - iconURL: moderator.user.avatarURL({ dynamic: true, format: 'png', size: 4096 }) ?? undefined - }) - .addField('**Action**', `${'Update Modlog'}`) - .addField('**Moderator**', `${moderator} (${moderator.user.tag})`) - .addField('**ModLog Changed**', modlogID) - .addField('**Value Changed**', key) - .addField('**Old Value**', await util.inspectCleanRedactCodeblock(oldModlog, undefined, undefined, 1024)) - .addField('**New Value**', await util.inspectCleanRedactCodeblock(newModlog, undefined, undefined, 1024)); - - return await logChannel.send({ embeds: [logEmbed] }); - } -} diff --git a/src/listeners/custom/bushUpdateSettings.ts b/src/listeners/custom/bushUpdateSettings.ts deleted file mode 100644 index c350bde..0000000 --- a/src/listeners/custom/bushUpdateSettings.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { BushListener, type BushClientEvents } from '#lib'; -import { MessageEmbed } from 'discord.js'; - -export default class BushUpdateSettingsListener extends BushListener { - public constructor() { - super('bushUpdateSettings', { - emitter: 'client', - event: 'bushUpdateSettings', - category: 'custom' - }); - } - - public override async exec(...[setting, guild, oldSettings, newSettings, moderator]: BushClientEvents['bushUpdateSettings']) { - const logChannel = await guild.getLogChannel('moderation'); - if (!logChannel) return; - - const logEmbed = new MessageEmbed().setColor(util.colors.discord.BLURPLE).setTimestamp(); - - if (moderator) - logEmbed.setAuthor({ - name: moderator.user.tag, - iconURL: moderator.user.avatarURL({ dynamic: true, format: 'png', size: 4096 }) ?? undefined - }); - logEmbed.addField('**Action**', `${'Update Settings'}`); - if (moderator) logEmbed.addField('**Moderator**', `${moderator} (${moderator.user.tag})`); - logEmbed - .addField('**Setting Changed**', setting) - .addField('**Old Value**', await util.inspectCleanRedactCodeblock(oldSettings, 'js', undefined, 1024)) - .addField('**New Value**', await util.inspectCleanRedactCodeblock(newSettings, 'js', undefined, 1024)); - - return await logChannel.send({ embeds: [logEmbed] }); - } -} diff --git a/src/listeners/custom/bushWarn.ts b/src/listeners/custom/bushWarn.ts deleted file mode 100644 index 1554aa4..0000000 --- a/src/listeners/custom/bushWarn.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { BushListener, type BushClientEvents } from '#lib'; -import { GuildMember, MessageEmbed } from 'discord.js'; - -export default class BushWarnListener extends BushListener { - public constructor() { - super('bushWarn', { - emitter: 'client', - event: 'bushWarn', - category: 'custom' - }); - } - - public override async exec(...[victim, moderator, guild, reason, caseID, dmSuccess]: BushClientEvents['bushWarn']) { - const logChannel = await guild.getLogChannel('moderation'); - if (!logChannel) return; - const user = victim instanceof GuildMember ? victim.user : victim; - - const logEmbed = new MessageEmbed() - .setColor(util.colors.discord.YELLOW) - .setTimestamp() - .setFooter({ text: `CaseID: ${caseID}` }) - .setAuthor({ name: user.tag, iconURL: user.avatarURL({ dynamic: true, format: 'png', size: 4096 }) ?? undefined }) - .addField('**Action**', `${'Warn'}`) - .addField('**User**', `${user} (${user.tag})`) - .addField('**Moderator**', `${moderator} (${moderator.tag})`) - // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing - .addField('**Reason**', `${reason || '[No Reason Provided]'}`); - if (dmSuccess === false) logEmbed.addField('**Additional Info**', 'Could not dm user.'); - return await logChannel.send({ embeds: [logEmbed] }); - } -} |