(interaction, config, client)
| 6 | |
| 7 | export default { |
| 8 | async execute(interaction, config, client) { |
| 9 | if (!interaction.member.permissions.has(PermissionsBitField.Flags.ManageGuild)) { |
| 10 | return await replyUserError(interaction, { type: ErrorTypes.PERMISSION, message: 'You need **Manage Server** permissions to set the report channel.' }); |
| 11 | } |
| 12 | |
| 13 | const channel = interaction.options.getChannel('channel'); |
| 14 | const guildId = interaction.guildId; |
| 15 | |
| 16 | try { |
| 17 | await setLogChannel(client, guildId, 'reports', channel.id); |
| 18 | |
| 19 | return InteractionHelper.safeReply(interaction, { |
| 20 | embeds: [successEmbed( |
| 21 | 'Report Channel Set', |
| 22 | `All new reports will now be sent to ${channel}.\nYou can also manage this from \`/logging dashboard\`.`, |
| 23 | )], |
| 24 | ephemeral: true, |
| 25 | }); |
| 26 | } catch (error) { |
| 27 | logger.error('report_setchannel error:', error); |
| 28 | return await replyUserError(interaction, { type: ErrorTypes.UNKNOWN, message: 'Could not save the channel configuration.' }); |
| 29 | } |
| 30 | }, |
| 31 | }; |
nothing calls this directly
no test coverage detected