From 3db443effca4c674b68003d2e1cfd9d460943c08 Mon Sep 17 00:00:00 2001 From: "Ean Milligan (Bastion)" Date: Thu, 4 May 2023 05:07:04 -0400 Subject: [PATCH] apply same change to log channel code --- src/commands/setup.ts | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/commands/setup.ts b/src/commands/setup.ts index 9671a8a..ece6c1e 100644 --- a/src/commands/setup.ts +++ b/src/commands/setup.ts @@ -110,10 +110,11 @@ const execute = async (bot: Bot, interaction: Interaction) => { name: 'Editing/Deleting your event:', value: 'To edit or delete your event, simply click on the ✏️ or 🗑️ buttons respectively.', }]; + const sendMessagePermSting = '`SEND_MESSAGES`\n`VIEW_CHANNEL`\n`EMBED_LINKS`' const permissionFields: Array = [ { name: `Please make sure ${config.name} has the following permissions for the current channel:`, - value: '`SEND_MESSAGES`\n`VIEW_CHANNEL`\n`EMBED_LINKS`', + value: sendMessagePermSting, }, { name: `Please make sure ${config.name} has the following permissions:`, @@ -164,18 +165,8 @@ const execute = async (bot: Bot, interaction: Interaction) => { The Discord Slash Command system will ensure you provide all the required details.`, }); - // Set permissions for self, skip if we already failed to set roles - !logChannelErrorOut && await bot.helpers.editChannelPermissionOverrides(logChannelId, { - id: botId, - type: OverwriteTypes.Member, - allow: ['SEND_MESSAGES', 'VIEW_CHANNEL', 'EMBED_LINKS'], - }).catch((e: Error) => { - utils.commonLoggers.channelUpdateError('setup.ts', 'self-allow', e); - mgrRoleErrorOut = true; - }); - // Test sending a message to the logChannel - !logChannelErrorOut && await bot.helpers.sendMessage(logChannelId, { + await bot.helpers.sendMessage(logChannelId, { embeds: [{ title: `This is the channel ${config.name} will be logging events to.`, description: `${config.name} will only send messages here as frequently as your event managers update events.`, @@ -197,8 +188,8 @@ The Discord Slash Command system will ensure you provide all the required detail description: `${config.name} attempted to send a message to the specified log channel.`, fields: [ { - name: `Please allow ${config.name} to send messages in the requested channel.`, - value: `<#${logChannelId}>`, + name: `Please make sure ${config.name} has the following permissions in the requested channel:`, + value: `${sendMessagePermSting}\n\nRequested Channel: <#${logChannelId}>`, }, ], }],