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

View file

@ -108,10 +108,6 @@ import { logVoiceChannelLeave } from "./logFunctions/logVoiceChannelLeave";
import { logVoiceChannelMove } from "./logFunctions/logVoiceChannelMove";
import { logMemberTimedUnban } from "./logFunctions/logMemberTimedUnban";
import { logDmFailed } from "./logFunctions/logDmFailed";
import { CasesPlugin } from "../Cases/CasesPlugin";
// Workaround for circular dependency
const AnyTypedCasesPlugin = CasesPlugin as any;
const defaultOptions: PluginOptions<LogsPluginType> = {
config: {
@ -143,7 +139,11 @@ export const LogsPlugin = zeppelinGuildPlugin<LogsPluginType>()({
prettyName: "Logs",
},
dependencies: () => [TimeAndDatePlugin, AnyTypedCasesPlugin],
dependencies: async () => [
TimeAndDatePlugin,
// The `as any` cast here is to prevent TypeScript from locking up from the circular dependency
((await import("../Cases/CasesPlugin")) as any).CasesPlugin,
],
configSchema: ConfigSchema,
defaultOptions,