3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-25 10:25:01 +00:00

fix: allow 0 deleteMessageDays and fix upper limit

This commit is contained in:
Ibotmealot 2022-02-19 19:04:58 -05:00 committed by GitHub
parent b3a6a86722
commit 7b75102f8e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -85,7 +85,7 @@ export async function banUserId(
pluginData.state.serverLogs.ignoreLog(LogType.MEMBER_BAN, userId); pluginData.state.serverLogs.ignoreLog(LogType.MEMBER_BAN, userId);
ignoreEvent(pluginData, IgnoredEventType.Ban, userId); ignoreEvent(pluginData, IgnoredEventType.Ban, userId);
try { try {
const deleteMessageDays = Math.min(30, Math.max(0, banOptions.deleteMessageDays ?? 1)); const deleteMessageDays = Math.min(7, Math.max(0, banOptions.deleteMessageDays ?? 1));
await pluginData.guild.bans.create(userId as Snowflake, { await pluginData.guild.bans.create(userId as Snowflake, {
days: deleteMessageDays, days: deleteMessageDays,
reason: reason ?? undefined, reason: reason ?? undefined,