From 5481971d8dae490a467dd592ca301e72acb2254a Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Thu, 30 Dec 2021 21:36:34 -0500 Subject: A bit of fixing --- src/listeners/client/akairoDebug.ts | 6 ++++-- src/listeners/client/interactionCreate.ts | 5 +++-- src/listeners/guild-custom/bushLockdown.ts | 9 +++++++-- src/listeners/guild-custom/bushUnlockdown.ts | 9 +++++++-- 4 files changed, 21 insertions(+), 8 deletions(-) (limited to 'src/listeners') diff --git a/src/listeners/client/akairoDebug.ts b/src/listeners/client/akairoDebug.ts index c8a28c4..0cb57a5 100644 --- a/src/listeners/client/akairoDebug.ts +++ b/src/listeners/client/akairoDebug.ts @@ -9,7 +9,9 @@ export default class DiscordJsDebugListener extends BushListener { }); } - public override async exec(...[message, ..._other]: BushClientEvents['debug']): Promise { - void client.console.superVerboseRaw('akairoDebug', message); + public override async exec(...[message, ...other]: BushClientEvents['debug']): Promise { + if (other.length && !message.includes('[registerInteractionCommands]')) + void client.console.superVerboseRaw('akairoDebug', message, ...other); + else void client.console.superVerbose('akairoDebug', message); } } diff --git a/src/listeners/client/interactionCreate.ts b/src/listeners/client/interactionCreate.ts index 26aa0a9..7eb2f10 100644 --- a/src/listeners/client/interactionCreate.ts +++ b/src/listeners/client/interactionCreate.ts @@ -20,8 +20,9 @@ export default class InteractionCreateListener extends BushListener { if (interaction.isCommand()) { return; } else if (interaction.isButton()) { - if (interaction.customId.startsWith('paginate_') || interaction.customId.startsWith('command_')) return; - else if (interaction.customId.startsWith('automod;')) void AutoMod.handleInteraction(interaction as BushButtonInteraction); + const id = interaction.customId; + if (id.startsWith('paginate_') || id.startsWith('command_') || id.startsWith('confirmationPrompt_')) return; + else if (id.startsWith('automod;')) void AutoMod.handleInteraction(interaction as BushButtonInteraction); else return await interaction.reply({ content: 'Buttons go brrr', ephemeral: true }); } else if (interaction.isSelectMenu()) { if (interaction.customId.startsWith('command_')) return; diff --git a/src/listeners/guild-custom/bushLockdown.ts b/src/listeners/guild-custom/bushLockdown.ts index be55a07..d48ddf1 100644 --- a/src/listeners/guild-custom/bushLockdown.ts +++ b/src/listeners/guild-custom/bushLockdown.ts @@ -10,7 +10,7 @@ export default class BushLockdownListener extends BushListener { }); } - public override async exec(...[moderator, reason, channel, _all]: BushClientEvents['bushLockdown']) { + public override async exec(...[moderator, reason, channelsSuccessMap, _all]: BushClientEvents['bushLockdown']) { const logChannel = await moderator.guild.getLogChannel('moderation'); if (!logChannel) return; @@ -21,7 +21,12 @@ export default class BushLockdownListener extends BushListener { .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]'}`); + .addField( + `**Channel${channelsSuccessMap.size > 1 ? 's' : ''}**`, + channelsSuccessMap + .map((success, channel) => `<#${channel}> ${success ? util.emojis.success : util.emojis.error}`) + .join('\n') + ); return await logChannel.send({ embeds: [logEmbed] }); } } diff --git a/src/listeners/guild-custom/bushUnlockdown.ts b/src/listeners/guild-custom/bushUnlockdown.ts index d5831c6..cfddc2f 100644 --- a/src/listeners/guild-custom/bushUnlockdown.ts +++ b/src/listeners/guild-custom/bushUnlockdown.ts @@ -10,7 +10,7 @@ export default class BushUnlockdownListener extends BushListener { }); } - public override async exec(...[moderator, reason, channel, _all]: BushClientEvents['bushUnlockdown']) { + public override async exec(...[moderator, reason, channelsSuccessMap, _all]: BushClientEvents['bushUnlockdown']) { const logChannel = await moderator.guild.getLogChannel('moderation'); if (!logChannel) return; @@ -21,7 +21,12 @@ export default class BushUnlockdownListener extends BushListener { .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]'}`); + .addField( + `**Channel${channelsSuccessMap.size > 1 ? 's' : ''}**`, + channelsSuccessMap + .map((success, channel) => `<#${channel}> ${success ? util.emojis.success : util.emojis.error}`) + .join('\n') + ); return await logChannel.send({ embeds: [logEmbed] }); } } -- cgit