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/guild-custom | |
parent | 1182f63498c856111762e2766d6cdddf063f2a97 (diff) | |
download | tanzanite-f0a9f894575871d498447c5de2b5f0f826b117b7.tar.gz tanzanite-f0a9f894575871d498447c5de2b5f0f826b117b7.tar.bz2 tanzanite-f0a9f894575871d498447c5de2b5f0f826b117b7.zip |
events
Diffstat (limited to 'src/listeners/guild-custom')
-rw-r--r-- | src/listeners/guild-custom/bushLockdown.ts | 27 | ||||
-rw-r--r-- | src/listeners/guild-custom/bushUnlockdown.ts | 27 |
2 files changed, 54 insertions, 0 deletions
diff --git a/src/listeners/guild-custom/bushLockdown.ts b/src/listeners/guild-custom/bushLockdown.ts new file mode 100644 index 0000000..be55a07 --- /dev/null +++ b/src/listeners/guild-custom/bushLockdown.ts @@ -0,0 +1,27 @@ +import { BushListener, type BushClientEvents } from '#lib'; +import { MessageEmbed } from 'discord.js'; + +export default class BushLockdownListener extends BushListener { + public constructor() { + super('bushLockdown', { + emitter: 'client', + event: 'bushLockdown', + category: 'guild-custom' + }); + } + + public override async exec(...[moderator, reason, channel, _all]: BushClientEvents['bushLockdown']) { + const logChannel = await moderator.guild.getLogChannel('moderation'); + if (!logChannel) return; + + const logEmbed = new MessageEmbed() + .setColor(util.colors.discord.BLURPLE) + .setTimestamp() + .addField('**Action**', `${'Lockdown'}`) + .addField('**Moderator**', `${moderator} (${moderator.user.tag})`) + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + .addField('**Reason**', `${reason || '[No Reason Provided]'}`) + .addField('**Channel**', `${channel?.id ? `<#${channel.id}>` : '[All Configured Channels]'}`); + return await logChannel.send({ embeds: [logEmbed] }); + } +} diff --git a/src/listeners/guild-custom/bushUnlockdown.ts b/src/listeners/guild-custom/bushUnlockdown.ts new file mode 100644 index 0000000..d5831c6 --- /dev/null +++ b/src/listeners/guild-custom/bushUnlockdown.ts @@ -0,0 +1,27 @@ +import { BushListener, type BushClientEvents } from '#lib'; +import { MessageEmbed } from 'discord.js'; + +export default class BushUnlockdownListener extends BushListener { + public constructor() { + super('bushUnlockdown', { + emitter: 'client', + event: 'bushUnlockdown', + category: 'guild-custom' + }); + } + + public override async exec(...[moderator, reason, channel, _all]: BushClientEvents['bushUnlockdown']) { + const logChannel = await moderator.guild.getLogChannel('moderation'); + if (!logChannel) return; + + const logEmbed = new MessageEmbed() + .setColor(util.colors.discord.BLURPLE) + .setTimestamp() + .addField('**Action**', `${'Unlockdown'}`) + .addField('**Moderator**', `${moderator} (${moderator.user.tag})`) + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + .addField('**Reason**', `${reason || '[No Reason Provided]'}`) + .addField('**Channel**', `${channel?.id ? `<#${channel.id}>` : '[All Configured Channels]'}`); + return await logChannel.send({ embeds: [logEmbed] }); + } +} |