mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 05:41:51 +00:00
default ban message (no reason specified)
This commit is contained in:
parent
3217f35017
commit
bf9d27dad0
1 changed files with 6 additions and 4 deletions
|
@ -42,10 +42,12 @@ export async function banUserId(
|
|||
};
|
||||
}
|
||||
|
||||
reason = reason || "No reason specified";
|
||||
|
||||
// Attempt to message the user *before* banning them, as doing it after may not be possible
|
||||
const member = await resolveMember(pluginData.client, pluginData.guild, userId);
|
||||
let notifyResult: UserNotificationResult = { method: null, success: true };
|
||||
if (reason && member) {
|
||||
if (member) {
|
||||
const contactMethods = banOptions?.contactMethods
|
||||
? banOptions.contactMethods
|
||||
: getDefaultContactMethods(pluginData, "ban");
|
||||
|
@ -91,7 +93,7 @@ export async function banUserId(
|
|||
const deleteMessageDays = Math.min(7, Math.max(0, banOptions.deleteMessageDays ?? 1));
|
||||
await pluginData.guild.bans.create(userId as Snowflake, {
|
||||
deleteMessageSeconds: (deleteMessageDays * DAYS) / SECONDS,
|
||||
reason: reason ?? undefined,
|
||||
reason,
|
||||
});
|
||||
} catch (e) {
|
||||
let errorMessage;
|
||||
|
@ -149,7 +151,7 @@ export async function banUserId(
|
|||
mod,
|
||||
user,
|
||||
caseNumber: createdCase.case_number,
|
||||
reason: reason ?? "",
|
||||
reason,
|
||||
banTime: humanizeDuration(banTime),
|
||||
});
|
||||
} else {
|
||||
|
@ -157,7 +159,7 @@ export async function banUserId(
|
|||
mod,
|
||||
user,
|
||||
caseNumber: createdCase.case_number,
|
||||
reason: reason ?? "",
|
||||
reason,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue