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

Commit

Permalink
Limit ban command delete message history to 7 days (Discord limitation)
Browse files Browse the repository at this point in the history
  • Loading branch information
RadiatedExodus committed Feb 8, 2024
1 parent a464700 commit bf98ca5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/commands/Moderation/Ban.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,11 @@ export const Command: MeteoriumCommand = {
const DelMsgHistoryParsed = DeleteMessageHistory ? ms(DeleteMessageHistory) * 1000 : undefined;
await interaction.guild.members.ban(User, {
reason: `Case ${CaseResult.CaseId} by ${interaction.user.username} (${interaction.user.id}): ${Reason}`,
deleteMessageSeconds: DelMsgHistoryParsed,
deleteMessageSeconds: DelMsgHistoryParsed
? DelMsgHistoryParsed >= 604800
? 604800
: DelMsgHistoryParsed
: undefined,
});

const PublicModLogChannel = await interaction.guild.channels
Expand Down

0 comments on commit bf98ca5

Please sign in to comment.