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

Add custom logger. Fix a bunch of errors. Optimize imports.

This commit is contained in:
Dragory 2020-07-22 22:56:21 +03:00
parent 0dae54745d
commit 1064a1ca46
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
89 changed files with 198 additions and 229 deletions

View file

@ -2,7 +2,8 @@ import { CaseArgs, CasesPluginType } from "../types";
import { resolveUser } from "../../../utils";
import { PluginData } from "knub";
import { createCaseNote } from "./createCaseNote";
import { postToCaseLogChannel } from "./postToCaseLogChannel";
import { postCaseToCaseLogChannel } from "./postToCaseLogChannel";
import { logger } from "../../../logger";
export async function createCase(pluginData: PluginData<CasesPluginType>, args: CaseArgs) {
const user = await resolveUser(pluginData.client, args.userId);
@ -21,7 +22,7 @@ export async function createCase(pluginData: PluginData<CasesPluginType>, args:
const existingAuditLogCase = await pluginData.state.cases.findByAuditLogId(args.auditLogId);
if (existingAuditLogCase) {
delete args.auditLogId;
console.warn(`Duplicate audit log ID for mod case: ${args.auditLogId}`);
logger.warn(`Duplicate audit log ID for mod case: ${args.auditLogId}`);
}
}
@ -66,7 +67,7 @@ export async function createCase(pluginData: PluginData<CasesPluginType>, args:
(!args.automatic || config.log_automatic_actions) &&
args.postInCaseLogOverride !== false
) {
await postToCaseLogChannel(pluginData, createdCase);
await postCaseToCaseLogChannel(pluginData, createdCase);
}
return createdCase;