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

Update to Knub 29. Set up config types for Knub.

This commit is contained in:
Dragory 2020-01-12 13:37:43 +02:00
parent 3e974e84b3
commit 94ef7b8ee0
6 changed files with 28 additions and 6 deletions

View file

@ -8,6 +8,7 @@ import { deepKeyIntersect, isSnowflake, isUnicodeEmoji, resolveMember, resolveUs
import { Member, User } from "eris";
import { performance } from "perf_hooks";
import { decodeAndValidateStrict, StrictValidationError } from "../validatorUtils";
import { TZeppelinKnub } from "../types";
const SLOW_RESOLVE_THRESHOLD = 1500;
@ -15,6 +16,8 @@ export class GlobalZeppelinPlugin<TConfig extends {} = IBasePluginConfig> extend
public static configSchema: t.TypeC<any>;
public static dependencies = [];
protected readonly knub: TZeppelinKnub;
/**
* Since we want to do type checking without creating instances of every plugin,
* we need a static version of getDefaultOptions(). This static version is then,

View file

@ -23,6 +23,8 @@ import DiscordRESTError from "eris/lib/errors/DiscordRESTError"; // tslint:disab
import { performance } from "perf_hooks";
import { decodeAndValidateStrict, StrictValidationError, validate } from "../validatorUtils";
import { SimpleCache } from "../SimpleCache";
import { Knub } from "knub/dist/Knub";
import { TZeppelinKnub } from "../types";
const SLOW_RESOLVE_THRESHOLD = 1500;
@ -67,6 +69,8 @@ export class ZeppelinPlugin<TConfig extends {} = IBasePluginConfig> extends Plug
public static configSchema: t.TypeC<any>;
public static dependencies = [];
protected readonly knub: TZeppelinKnub;
protected throwPluginRuntimeError(message: string) {
throw new PluginRuntimeError(message, this.runtimePluginName, this.guildId);
}