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

fix undefined typing lole

This commit is contained in:
metal 2021-09-23 09:59:42 +00:00 committed by almeidx
parent 57b9540edf
commit 63ac8b89aa
No known key found for this signature in database
GPG key ID: F403F80B79353CB4
6 changed files with 6 additions and 6 deletions

View file

@ -60,7 +60,7 @@ export const AddCaseCmd = modActionsCmd({
return;
}
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
const casesPlugin = pluginData.getPlugin(CasesPlugin);

View file

@ -63,7 +63,7 @@ export const ForcebanCmd = modActionsCmd({
mod = args.mod;
}
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);
pluginData.state.serverLogs.ignoreLog(LogType.MEMBER_BAN, user.id);

View file

@ -41,7 +41,7 @@ export const MassunbanCmd = modActionsCmd({
const unbanReason = parseReason(
config,
formatReasonWithAttachments(unbanReasonReply.content, [...msg.attachments.values()]),
)!;
);
// Ignore automatic unban cases and logs for these users
// We'll create our own cases below and post a single "mass unbanned" log instead

View file

@ -64,7 +64,7 @@ export const WarnCmd = modActionsCmd({
}
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 priorWarnAmount = await casesPlugin.getCaseTypeAmountForUserId(memberToWarn.id, CaseTypes.Warn);

View file

@ -1,6 +1,6 @@
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 (config?.reason_aliases) {
reason = config.reason_aliases![reason.toLowerCase()] ?? reason;

View file

@ -18,7 +18,7 @@ export async function warnMember(
warnOptions: WarnOptions = {},
): Promise<WarnResult> {
const config = pluginData.config.get();
reason = parseReason(config, reason)!;
reason = parseReason(config, reason);
let notifyResult: UserNotificationResult;
if (config.warn_message) {
const warnMessage = await renderTemplate(