mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-25 10:25:01 +00:00
fix undefined typing lole
This commit is contained in:
parent
57b9540edf
commit
63ac8b89aa
6 changed files with 6 additions and 6 deletions
|
@ -60,7 +60,7 @@ export const AddCaseCmd = modActionsCmd({
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const config = pluginData.config.get();
|
const config = pluginData.config.get();
|
||||||
const reason = parseReason(config, formatReasonWithAttachments(args.reason, [...msg.attachments.values()]))!;
|
const reason = parseReason(config, formatReasonWithAttachments(args.reason, [...msg.attachments.values()]));
|
||||||
|
|
||||||
// Create the case
|
// Create the case
|
||||||
const casesPlugin = pluginData.getPlugin(CasesPlugin);
|
const casesPlugin = pluginData.getPlugin(CasesPlugin);
|
||||||
|
|
|
@ -63,7 +63,7 @@ export const ForcebanCmd = modActionsCmd({
|
||||||
mod = args.mod;
|
mod = args.mod;
|
||||||
}
|
}
|
||||||
const config = pluginData.config.get();
|
const config = pluginData.config.get();
|
||||||
const reason = parseReason(config, formatReasonWithAttachments(args.reason, [...msg.attachments.values()]))!;
|
const reason = parseReason(config, formatReasonWithAttachments(args.reason, [...msg.attachments.values()]));
|
||||||
|
|
||||||
ignoreEvent(pluginData, IgnoredEventType.Ban, user.id);
|
ignoreEvent(pluginData, IgnoredEventType.Ban, user.id);
|
||||||
pluginData.state.serverLogs.ignoreLog(LogType.MEMBER_BAN, user.id);
|
pluginData.state.serverLogs.ignoreLog(LogType.MEMBER_BAN, user.id);
|
||||||
|
|
|
@ -41,7 +41,7 @@ export const MassunbanCmd = modActionsCmd({
|
||||||
const unbanReason = parseReason(
|
const unbanReason = parseReason(
|
||||||
config,
|
config,
|
||||||
formatReasonWithAttachments(unbanReasonReply.content, [...msg.attachments.values()]),
|
formatReasonWithAttachments(unbanReasonReply.content, [...msg.attachments.values()]),
|
||||||
)!;
|
);
|
||||||
|
|
||||||
// Ignore automatic unban cases and logs for these users
|
// Ignore automatic unban cases and logs for these users
|
||||||
// We'll create our own cases below and post a single "mass unbanned" log instead
|
// We'll create our own cases below and post a single "mass unbanned" log instead
|
||||||
|
|
|
@ -64,7 +64,7 @@ export const WarnCmd = modActionsCmd({
|
||||||
}
|
}
|
||||||
|
|
||||||
const config = pluginData.config.get();
|
const config = pluginData.config.get();
|
||||||
const reason = parseReason(config, formatReasonWithAttachments(args.reason, [...msg.attachments.values()]))!;
|
const reason = parseReason(config, formatReasonWithAttachments(args.reason, [...msg.attachments.values()]));
|
||||||
|
|
||||||
const casesPlugin = pluginData.getPlugin(CasesPlugin);
|
const casesPlugin = pluginData.getPlugin(CasesPlugin);
|
||||||
const priorWarnAmount = await casesPlugin.getCaseTypeAmountForUserId(memberToWarn.id, CaseTypes.Warn);
|
const priorWarnAmount = await casesPlugin.getCaseTypeAmountForUserId(memberToWarn.id, CaseTypes.Warn);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
const MAX_REASON_LENGTH = 512;
|
const MAX_REASON_LENGTH = 512;
|
||||||
|
|
||||||
export function parseReason(config: any, reason?: string): string | undefined {
|
export function parseReason(config: any, reason: string): string {
|
||||||
if (!reason) return reason;
|
if (!reason) return reason;
|
||||||
if (config?.reason_aliases) {
|
if (config?.reason_aliases) {
|
||||||
reason = config.reason_aliases![reason.toLowerCase()] ?? reason;
|
reason = config.reason_aliases![reason.toLowerCase()] ?? reason;
|
||||||
|
|
|
@ -18,7 +18,7 @@ export async function warnMember(
|
||||||
warnOptions: WarnOptions = {},
|
warnOptions: WarnOptions = {},
|
||||||
): Promise<WarnResult> {
|
): Promise<WarnResult> {
|
||||||
const config = pluginData.config.get();
|
const config = pluginData.config.get();
|
||||||
reason = parseReason(config, reason)!;
|
reason = parseReason(config, reason);
|
||||||
let notifyResult: UserNotificationResult;
|
let notifyResult: UserNotificationResult;
|
||||||
if (config.warn_message) {
|
if (config.warn_message) {
|
||||||
const warnMessage = await renderTemplate(
|
const warnMessage = await renderTemplate(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue