Skip to content
This repository has been archived by the owner on Oct 12, 2024. It is now read-only.

Commit

Permalink
Int-CI-Moderation-CreateCase: Add publish option to control publishin…
Browse files Browse the repository at this point in the history
…g to public mod log. Fixes #33
  • Loading branch information
RadiatedExodus committed May 28, 2024
1 parent 6ac3f12 commit 303a5b1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/interactions/commands/moderation/createCase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ export const Command: MeteoriumChatCommand = {
.addBooleanOption((option) =>
option.setName("notappealable").setDescription("Is this ban appealable?").setRequired(false),
)
.addBooleanOption((option) =>
option
.setName("publish")
.setDescription("Publishes the case info to the public mod log")
.setRequired(false),
)
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false),
requiredFeature: GuildFeatures.Moderation,
Expand All @@ -71,6 +77,7 @@ export const Command: MeteoriumChatCommand = {
const moderationNote = interaction.options.getString("modnote", false);
const moderationAttach = interaction.options.getAttachment("modattach", false);
const notAppealable = interaction.options.getBoolean("notappealable", false);
const publish = interaction.options.getBoolean("publish", false);

// Determine action
let action: ModerationAction;
Expand Down Expand Up @@ -264,7 +271,7 @@ export const Command: MeteoriumChatCommand = {
});

// Post in public moderation log
if (dbDataEmbedPublic)
if (dbDataEmbedPublic && publish)
await client.dbUtils.sendGuildPubLog(interaction.guildId, { embeds: [dbDataEmbedPublic] });

// Post in internal server log
Expand Down

0 comments on commit 303a5b1

Please sign in to comment.