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-UnBan: Fix relcid get failing and actually unban user
Browse files Browse the repository at this point in the history
  • Loading branch information
RealEthanPlayzDev committed Apr 25, 2024
1 parent 9b95465 commit 593f0dd
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/interactions/commands/moderation/unban.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ export const Command: MeteoriumChatCommand = {
.setName("unban")
.setDescription("Deactivate a ban punishment")
.addNumberOption((option) =>
option.setName("relcid").setDescription("The ban case id that will be deactivated"),
option.setName("relcid").setDescription("The ban case id that will be deactivated").setRequired(true),
)
.addStringOption((option) =>
option.setName("reason").setDescription("The reason why this user was pardoned").setRequired(true),
option.setName("reason").setDescription("The reason why this user was unbanned").setRequired(true),
)
.addAttachmentOption((option) =>
option
.setName("proof")
.setDescription("The attachment proof on why this user received the pardon")
.setDescription("The attachment proof on why this user got unbanned")
.setRequired(false),
)
.addStringOption((option) =>
Expand All @@ -28,7 +28,7 @@ export const Command: MeteoriumChatCommand = {
.setDMPermission(false),
requiredFeature: GuildFeatures.Moderation,
async callback(interaction, client) {
const relatedCaseId = interaction.options.getInteger("relcid", true);
const relatedCaseId = interaction.options.getNumber("relcid", true);
const reason = interaction.options.getString("reason", true);
const proof = interaction.options.getAttachment("proof", false);
const moderationNote = interaction.options.getString("modnote", false);
Expand Down Expand Up @@ -90,6 +90,9 @@ export const Command: MeteoriumChatCommand = {
},
});

// Unban
await interaction.guild.members.unban(banCase.TargetUserId, `Case #${caseId}: ${reason}`);

// Edit reply
await interaction.editReply({
content: `Deactivated ban in case #${relatedCaseId}.`,
Expand Down

0 comments on commit 593f0dd

Please sign in to comment.