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

Type fixes + circular dependency fix

This commit is contained in:
Dragory 2021-08-18 20:01:06 +03:00
parent e3b6b017a2
commit 59e75e0584
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
20 changed files with 70 additions and 83 deletions
backend/src/plugins/Cases

View file

@ -16,10 +16,6 @@ import { getRecentCasesByMod } from "./functions/getRecentCasesByMod";
import { getTotalCasesByMod } from "./functions/getTotalCasesByMod";
import { postCaseToCaseLogChannel } from "./functions/postToCaseLogChannel";
import { CaseArgs, CaseNoteArgs, CasesPluginType, ConfigSchema } from "./types";
import { LogsPlugin } from "../Logs/LogsPlugin";
// Workaround for circular dependency
const AnyTypedLogsPlugin = LogsPlugin as any;
const defaultOptions = {
config: {
@ -42,7 +38,11 @@ export const CasesPlugin = zeppelinGuildPlugin<CasesPluginType>()({
`),
},
dependencies: () => [TimeAndDatePlugin, AnyTypedLogsPlugin],
dependencies: async () => [
TimeAndDatePlugin,
// The `as any` cast here is to prevent TypeScript from locking up from the circular dependency
((await import("../Logs/LogsPlugin")) as any).LogsPlugin,
],
configSchema: ConfigSchema,
defaultOptions,