mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 05:41:51 +00:00
add default option
This commit is contained in:
parent
bf9d27dad0
commit
ac3eb74500
3 changed files with 24 additions and 22 deletions
|
@ -62,6 +62,7 @@ const defaultOptions = {
|
|||
kick_message: "You have been kicked from the {guildName} server. Reason given: {reason}",
|
||||
ban_message: "You have been banned from the {guildName} server. Reason given: {reason}",
|
||||
tempban_message: "You have been banned from the {guildName} server for {banTime}. Reason given: {reason}",
|
||||
default_ban_reason: "No reason specified",
|
||||
alert_on_rejoin: false,
|
||||
alert_channel: null,
|
||||
warn_notify_enabled: false,
|
||||
|
|
|
@ -42,7 +42,7 @@ export async function banUserId(
|
|||
};
|
||||
}
|
||||
|
||||
reason = reason || "No reason specified";
|
||||
reason = reason || (config.default_ban_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);
|
||||
|
|
|
@ -23,6 +23,7 @@ export const ConfigSchema = t.type({
|
|||
kick_message: tNullable(t.string),
|
||||
ban_message: tNullable(t.string),
|
||||
tempban_message: tNullable(t.string),
|
||||
default_ban_reason: tNullable(t.string),
|
||||
alert_on_rejoin: t.boolean,
|
||||
alert_channel: tNullable(t.string),
|
||||
warn_notify_enabled: t.boolean,
|
||||
|
@ -91,36 +92,36 @@ export interface IIgnoredEvent {
|
|||
|
||||
export type WarnResult =
|
||||
| {
|
||||
status: "failed";
|
||||
error: string;
|
||||
}
|
||||
status: "failed";
|
||||
error: string;
|
||||
}
|
||||
| {
|
||||
status: "success";
|
||||
case: Case;
|
||||
notifyResult: UserNotificationResult;
|
||||
};
|
||||
status: "success";
|
||||
case: Case;
|
||||
notifyResult: UserNotificationResult;
|
||||
};
|
||||
|
||||
export type KickResult =
|
||||
| {
|
||||
status: "failed";
|
||||
error: string;
|
||||
}
|
||||
status: "failed";
|
||||
error: string;
|
||||
}
|
||||
| {
|
||||
status: "success";
|
||||
case: Case;
|
||||
notifyResult: UserNotificationResult;
|
||||
};
|
||||
status: "success";
|
||||
case: Case;
|
||||
notifyResult: UserNotificationResult;
|
||||
};
|
||||
|
||||
export type BanResult =
|
||||
| {
|
||||
status: "failed";
|
||||
error: string;
|
||||
}
|
||||
status: "failed";
|
||||
error: string;
|
||||
}
|
||||
| {
|
||||
status: "success";
|
||||
case: Case;
|
||||
notifyResult: UserNotificationResult;
|
||||
};
|
||||
status: "success";
|
||||
case: Case;
|
||||
notifyResult: UserNotificationResult;
|
||||
};
|
||||
|
||||
export type WarnMemberNotifyRetryCallback = () => boolean | Promise<boolean>;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue