mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-25 18:25:03 +00:00
fix: allow 0 deleteMessageDays and fix upper limit
This commit is contained in:
parent
b3a6a86722
commit
7b75102f8e
1 changed files with 1 additions and 1 deletions
|
@ -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,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue