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

@ -1,4 +1,4 @@
import { plugin, PluginData } from "knub";
import { PluginData } from "knub";
import { CasesPluginType } from "../types";
import { Message, MessageContent, MessageFile, TextChannel } from "eris";
import { isDiscordRESTError } from "../../../utils";
@ -6,6 +6,7 @@ import { LogType } from "../../../data/LogType";
import { Case } from "../../../data/entities/Case";
import { getCaseEmbed } from "./getCaseEmbed";
import { resolveCaseId } from "./resolveCaseId";
import { logger } from "../../../logger";
export async function postToCaseLogChannel(
pluginData: PluginData<CasesPluginType>,
@ -23,7 +24,7 @@ export async function postToCaseLogChannel(
result = await caseLogChannel.createMessage(content, file);
} catch (e) {
if (isDiscordRESTError(e) && (e.code === 50013 || e.code === 50001)) {
console.warn(
logger.warn(
`Missing permissions to post mod cases in <#${caseLogChannel.id}> in guild ${pluginData.guild.name} (${pluginData.guild.id})`,
);
pluginData.state.logs.log(LogType.BOT_ALERT, {