mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-25 18:25:03 +00:00
feat: knub v32-next; related fixes
This commit is contained in:
parent
448293d6ac
commit
c36d47e0b8
89 changed files with 287 additions and 931 deletions
23
backend/package-lock.json
generated
23
backend/package-lock.json
generated
|
@ -23,7 +23,7 @@
|
||||||
"humanize-duration": "^3.15.0",
|
"humanize-duration": "^3.15.0",
|
||||||
"io-ts": "^2.0.0",
|
"io-ts": "^2.0.0",
|
||||||
"js-yaml": "^3.13.1",
|
"js-yaml": "^3.13.1",
|
||||||
"knub": "^31.0.0",
|
"knub": "^32.0.0-next.4",
|
||||||
"knub-command-manager": "^9.1.0",
|
"knub-command-manager": "^9.1.0",
|
||||||
"last-commit-log": "^2.1.0",
|
"last-commit-log": "^2.1.0",
|
||||||
"lodash.chunk": "^4.2.0",
|
"lodash.chunk": "^4.2.0",
|
||||||
|
@ -2704,15 +2704,17 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/knub": {
|
"node_modules/knub": {
|
||||||
"version": "31.0.0",
|
"version": "32.0.0-next.4",
|
||||||
"resolved": "https://registry.npmjs.org/knub/-/knub-31.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/knub/-/knub-32.0.0-next.4.tgz",
|
||||||
"integrity": "sha512-mm2PrtQ9G5UoELfJ4kjWaNQZZRMhwJbCf4FgJj92iDy4pg95XPNWAkwTw8avbkslNjb9m5Va1pp3IeJayvz/ag==",
|
"integrity": "sha512-ywZbwcGFSr4Erl/nEUDVmziQHXKVIykWtI2Z05DLt01YmxDS+rTO8l/E6LYx7ZL3m+f2DbtLH0HB8zaZb0pUag==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"discord-api-types": "^0.37.10",
|
"discord.js": "^14.8.0",
|
||||||
"discord.js": "^14",
|
|
||||||
"knub-command-manager": "^9.1.0",
|
"knub-command-manager": "^9.1.0",
|
||||||
"ts-essentials": "^9",
|
"ts-essentials": "^9",
|
||||||
"zod": "^3.19.1"
|
"zod": "^3.19.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=16"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/knub-command-manager": {
|
"node_modules/knub-command-manager": {
|
||||||
|
@ -7199,12 +7201,11 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"knub": {
|
"knub": {
|
||||||
"version": "31.0.0",
|
"version": "32.0.0-next.4",
|
||||||
"resolved": "https://registry.npmjs.org/knub/-/knub-31.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/knub/-/knub-32.0.0-next.4.tgz",
|
||||||
"integrity": "sha512-mm2PrtQ9G5UoELfJ4kjWaNQZZRMhwJbCf4FgJj92iDy4pg95XPNWAkwTw8avbkslNjb9m5Va1pp3IeJayvz/ag==",
|
"integrity": "sha512-ywZbwcGFSr4Erl/nEUDVmziQHXKVIykWtI2Z05DLt01YmxDS+rTO8l/E6LYx7ZL3m+f2DbtLH0HB8zaZb0pUag==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"discord-api-types": "^0.37.10",
|
"discord.js": "^14.8.0",
|
||||||
"discord.js": "^14",
|
|
||||||
"knub-command-manager": "^9.1.0",
|
"knub-command-manager": "^9.1.0",
|
||||||
"ts-essentials": "^9",
|
"ts-essentials": "^9",
|
||||||
"zod": "^3.19.1"
|
"zod": "^3.19.1"
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
"humanize-duration": "^3.15.0",
|
"humanize-duration": "^3.15.0",
|
||||||
"io-ts": "^2.0.0",
|
"io-ts": "^2.0.0",
|
||||||
"js-yaml": "^3.13.1",
|
"js-yaml": "^3.13.1",
|
||||||
"knub": "^31.0.0",
|
"knub": "^32.0.0-next.4",
|
||||||
"knub-command-manager": "^9.1.0",
|
"knub-command-manager": "^9.1.0",
|
||||||
"last-commit-log": "^2.1.0",
|
"last-commit-log": "^2.1.0",
|
||||||
"lodash.chunk": "^4.2.0",
|
"lodash.chunk": "^4.2.0",
|
||||||
|
|
|
@ -66,7 +66,7 @@ export function initDocs(app: express.Express) {
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const defaultOptions = plugin.defaultOptions || {};
|
const defaultOptions = plugin.defaultOptions || {};
|
||||||
const configSchema = plugin.configSchema && formatConfigSchema(plugin.configSchema);
|
const configSchema = plugin.info?.configSchema && formatConfigSchema(plugin.info.configSchema);
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
name,
|
name,
|
||||||
|
|
|
@ -20,5 +20,5 @@ setIsAPI(true);
|
||||||
// Connect to the database before loading the rest of the code (that depend on the database connection)
|
// Connect to the database before loading the rest of the code (that depend on the database connection)
|
||||||
console.log("Connecting to database..."); // tslint:disable-line
|
console.log("Connecting to database..."); // tslint:disable-line
|
||||||
connect().then(() => {
|
connect().then(() => {
|
||||||
import("./start");
|
import("./start.js");
|
||||||
});
|
});
|
||||||
|
|
|
@ -36,7 +36,7 @@ export async function validateGuildConfig(config: any): Promise<string | null> {
|
||||||
const plugin = pluginNameToPlugin.get(pluginName)!;
|
const plugin = pluginNameToPlugin.get(pluginName)!;
|
||||||
try {
|
try {
|
||||||
const mergedOptions = configUtils.mergeConfig(plugin.defaultOptions || {}, pluginOptions);
|
const mergedOptions = configUtils.mergeConfig(plugin.defaultOptions || {}, pluginOptions);
|
||||||
await plugin.configParser?.(mergedOptions as unknown as PluginOptions<any>, true);
|
await plugin.configParser?.(mergedOptions as unknown as PluginOptions<any>);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err instanceof ConfigValidationError || err instanceof StrictValidationError) {
|
if (err instanceof ConfigValidationError || err instanceof StrictValidationError) {
|
||||||
return `${pluginName}: ${err.message}`;
|
return `${pluginName}: ${err.message}`;
|
||||||
|
|
|
@ -2,21 +2,14 @@ import {
|
||||||
Client,
|
Client,
|
||||||
Events,
|
Events,
|
||||||
GatewayIntentBits,
|
GatewayIntentBits,
|
||||||
GuildTextBasedChannel,
|
|
||||||
Message,
|
|
||||||
Options,
|
Options,
|
||||||
Partials,
|
Partials,
|
||||||
RESTEvents,
|
RESTEvents,
|
||||||
TextBasedChannel,
|
|
||||||
TextChannel,
|
TextChannel,
|
||||||
ThreadChannel,
|
ThreadChannel,
|
||||||
} from "discord.js";
|
} from "discord.js";
|
||||||
import { Knub, PluginError } from "knub";
|
|
||||||
import { PluginLoadError } from "knub/dist/plugins/PluginLoadError";
|
|
||||||
// Always use UTC internally
|
|
||||||
// This is also enforced for the database in data/db.ts
|
|
||||||
import { EventEmitter } from "events";
|
import { EventEmitter } from "events";
|
||||||
import { PluginNotLoadedError } from "knub/dist/plugins/PluginNotLoadedError";
|
import { Knub, PluginError, PluginLoadError, PluginNotLoadedError } from "knub";
|
||||||
import moment from "moment-timezone";
|
import moment from "moment-timezone";
|
||||||
import { performance } from "perf_hooks";
|
import { performance } from "perf_hooks";
|
||||||
import { AllowedGuilds } from "./data/AllowedGuilds";
|
import { AllowedGuilds } from "./data/AllowedGuilds";
|
||||||
|
@ -48,18 +41,6 @@ import { DecayingCounter } from "./utils/DecayingCounter";
|
||||||
import { enableProfiling } from "./utils/easyProfiler";
|
import { enableProfiling } from "./utils/easyProfiler";
|
||||||
import { loadYamlSafely } from "./utils/loadYamlSafely";
|
import { loadYamlSafely } from "./utils/loadYamlSafely";
|
||||||
|
|
||||||
// TODO: Remove this once fixed on upstream
|
|
||||||
declare module "knub/dist/helpers" {
|
|
||||||
export function waitForReply(
|
|
||||||
client: Client,
|
|
||||||
channel: GuildTextBasedChannel,
|
|
||||||
restrictToUserId?: string,
|
|
||||||
timeout?: number,
|
|
||||||
): Promise<Message | null>;
|
|
||||||
|
|
||||||
export function createChunkedMessage(channel: TextBasedChannel, messageText: string): Promise<Message[]>;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Error handling
|
// Error handling
|
||||||
let recentPluginErrors = 0;
|
let recentPluginErrors = 0;
|
||||||
const RECENT_PLUGIN_ERROR_EXIT_THRESHOLD = 5;
|
const RECENT_PLUGIN_ERROR_EXIT_THRESHOLD = 5;
|
||||||
|
@ -184,6 +165,8 @@ for (const [i, part] of actualVersionParts.entries()) {
|
||||||
throw new SimpleError(`Unsupported Node.js version! Must be at least ${REQUIRED_NODE_VERSION}`);
|
throw new SimpleError(`Unsupported Node.js version! Must be at least ${REQUIRED_NODE_VERSION}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Always use UTC internally
|
||||||
|
// This is also enforced for the database in data/db.ts
|
||||||
moment.tz.setDefault("UTC");
|
moment.tz.setDefault("UTC");
|
||||||
|
|
||||||
// Blocking check
|
// Blocking check
|
||||||
|
|
|
@ -4,17 +4,21 @@
|
||||||
|
|
||||||
import { GuildMember, Message, MessageCreateOptions, MessageMentionOptions, TextBasedChannel } from "discord.js";
|
import { GuildMember, Message, MessageCreateOptions, MessageMentionOptions, TextBasedChannel } from "discord.js";
|
||||||
import * as t from "io-ts";
|
import * as t from "io-ts";
|
||||||
import { CommandContext, configUtils, ConfigValidationError, GuildPluginData, helpers, PluginOptions } from "knub";
|
import {
|
||||||
import { PluginOverrideCriteria } from "knub/dist/config/configTypes";
|
AnyPluginData,
|
||||||
import { ExtendedMatchParams } from "knub/dist/config/PluginConfigManager"; // TODO: Export from Knub index
|
CommandContext,
|
||||||
import { AnyPluginData } from "knub/dist/plugins/PluginData";
|
ConfigValidationError,
|
||||||
|
ExtendedMatchParams,
|
||||||
|
GuildPluginData,
|
||||||
|
helpers,
|
||||||
|
PluginOverrideCriteria,
|
||||||
|
} from "knub";
|
||||||
import { logger } from "./logger";
|
import { logger } from "./logger";
|
||||||
import { ZeppelinPlugin } from "./plugins/ZeppelinPlugin";
|
|
||||||
import { isStaff } from "./staff";
|
import { isStaff } from "./staff";
|
||||||
import { TZeppelinKnub } from "./types";
|
import { TZeppelinKnub } from "./types";
|
||||||
import { deepKeyIntersect, errorMessage, successMessage, tDeepPartial, tNullable } from "./utils";
|
import { errorMessage, successMessage, tNullable } from "./utils";
|
||||||
import { Tail } from "./utils/typeUtils";
|
import { Tail } from "./utils/typeUtils";
|
||||||
import { decodeAndValidateStrict, StrictValidationError, validate } from "./validatorUtils";
|
import { StrictValidationError, validate } from "./validatorUtils";
|
||||||
|
|
||||||
const { getMemberLevel } = helpers;
|
const { getMemberLevel } = helpers;
|
||||||
|
|
||||||
|
@ -91,102 +95,13 @@ export function strictValidationErrorToConfigValidationError(err: StrictValidati
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getPluginConfigParser(blueprint: ZeppelinPlugin, customParser?: ZeppelinPlugin["configParser"]) {
|
export function makeIoTsConfigParser<Schema extends t.Type<any>>(schema: Schema): (input: unknown) => t.TypeOf<Schema> {
|
||||||
return async (options: PluginOptions<any>, strict?: boolean) => {
|
return (input: unknown) => {
|
||||||
const ident = `[getPluginConfigParser.${blueprint.name}] | `;
|
const error = validate(schema, input);
|
||||||
if (blueprint.name === "mutes") {
|
if (error) {
|
||||||
console.log(ident, "options => ", JSON.stringify(options));
|
throw error;
|
||||||
}
|
}
|
||||||
|
return input as t.TypeOf<Schema>;
|
||||||
// 1. Validate the basic structure of plugin config
|
|
||||||
const basicOptionsValidation = validate(BasicPluginStructureType, options);
|
|
||||||
if (basicOptionsValidation instanceof StrictValidationError) {
|
|
||||||
throw strictValidationErrorToConfigValidationError(basicOptionsValidation);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 2. Validate config/overrides against *partial* config schema. This ensures valid properties have valid types.
|
|
||||||
const partialConfigSchema = tDeepPartial(blueprint.configSchema);
|
|
||||||
|
|
||||||
if (options.config) {
|
|
||||||
const partialConfigValidation = validate(partialConfigSchema, options.config);
|
|
||||||
if (partialConfigValidation instanceof StrictValidationError) {
|
|
||||||
throw strictValidationErrorToConfigValidationError(partialConfigValidation);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options.overrides) {
|
|
||||||
for (const override of options.overrides) {
|
|
||||||
// Validate criteria and extra criteria
|
|
||||||
// FIXME: This is ugly
|
|
||||||
for (const key of Object.keys(override)) {
|
|
||||||
if (!validTopLevelOverrideKeys.includes(key)) {
|
|
||||||
if (strict) {
|
|
||||||
throw new ConfigValidationError(`Unknown override criterion '${key}'`);
|
|
||||||
}
|
|
||||||
|
|
||||||
delete override[key];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (override.extra != null) {
|
|
||||||
for (const extraCriterion of Object.keys(override.extra)) {
|
|
||||||
if (!blueprint.customOverrideCriteriaFunctions?.[extraCriterion]) {
|
|
||||||
if (strict) {
|
|
||||||
throw new ConfigValidationError(`Unknown override extra criterion '${extraCriterion}'`);
|
|
||||||
}
|
|
||||||
|
|
||||||
delete override.extra[extraCriterion];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Validate override config
|
|
||||||
const partialOverrideConfigValidation = decodeAndValidateStrict(partialConfigSchema, override.config || {});
|
|
||||||
if (partialOverrideConfigValidation instanceof StrictValidationError) {
|
|
||||||
throw strictValidationErrorToConfigValidationError(partialOverrideConfigValidation);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 3. Run custom parser, if any
|
|
||||||
if (customParser) {
|
|
||||||
options = await customParser(options);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 4. Merge with default options and validate/decode the entire config
|
|
||||||
let decodedConfig = {};
|
|
||||||
const decodedOverrides: Array<PluginOverrideCriteria<unknown> & { config: any }> = [];
|
|
||||||
|
|
||||||
if (options.config) {
|
|
||||||
decodedConfig = blueprint.configSchema
|
|
||||||
? decodeAndValidateStrict(blueprint.configSchema, options.config)
|
|
||||||
: options.config;
|
|
||||||
if (decodedConfig instanceof StrictValidationError) {
|
|
||||||
console.error("4.strict:", blueprint.name);
|
|
||||||
throw strictValidationErrorToConfigValidationError(decodedConfig);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options.overrides) {
|
|
||||||
for (const override of options.overrides) {
|
|
||||||
const overrideConfigMergedWithBaseConfig = configUtils.mergeConfig(options.config || {}, override.config || {});
|
|
||||||
const decodedOverrideConfig = blueprint.configSchema
|
|
||||||
? decodeAndValidateStrict(blueprint.configSchema, overrideConfigMergedWithBaseConfig)
|
|
||||||
: overrideConfigMergedWithBaseConfig;
|
|
||||||
if (decodedOverrideConfig instanceof StrictValidationError) {
|
|
||||||
console.error("4.overrides.strict:", blueprint.name, options, decodedOverrideConfig);
|
|
||||||
throw strictValidationErrorToConfigValidationError(decodedOverrideConfig);
|
|
||||||
}
|
|
||||||
decodedOverrides.push({
|
|
||||||
...override,
|
|
||||||
config: deepKeyIntersect(decodedOverrideConfig, override.config || {}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
config: decodedConfig,
|
|
||||||
overrides: decodedOverrides,
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions } from "knub";
|
||||||
import { GuildLogs } from "../../data/GuildLogs";
|
import { GuildLogs } from "../../data/GuildLogs";
|
||||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||||
|
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||||
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||||
|
@ -23,10 +24,11 @@ export const AutoDeletePlugin = zeppelinGuildPlugin<AutoDeletePluginType>()({
|
||||||
prettyName: "Auto-delete",
|
prettyName: "Auto-delete",
|
||||||
description: "Allows Zeppelin to auto-delete messages from a channel after a delay",
|
description: "Allows Zeppelin to auto-delete messages from a channel after a delay",
|
||||||
configurationGuide: "Maximum deletion delay is currently 5 minutes",
|
configurationGuide: "Maximum deletion delay is currently 5 minutes",
|
||||||
|
configSchema: ConfigSchema,
|
||||||
},
|
},
|
||||||
|
|
||||||
dependencies: () => [TimeAndDatePlugin, LogsPlugin],
|
dependencies: () => [TimeAndDatePlugin, LogsPlugin],
|
||||||
configSchema: ConfigSchema,
|
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
|
|
||||||
beforeLoad(pluginData) {
|
beforeLoad(pluginData) {
|
||||||
|
@ -62,7 +64,4 @@ export const AutoDeletePlugin = zeppelinGuildPlugin<AutoDeletePluginType>()({
|
||||||
state.guildSavedMessages.events.off("delete", state.onMessageDeleteFn);
|
state.guildSavedMessages.events.off("delete", state.onMessageDeleteFn);
|
||||||
state.guildSavedMessages.events.off("deleteBulk", state.onMessageDeleteBulkFn);
|
state.guildSavedMessages.events.off("deleteBulk", state.onMessageDeleteBulkFn);
|
||||||
},
|
},
|
||||||
|
|
||||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
|
||||||
configParser: (o: any) => o,
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions } from "knub";
|
||||||
import { GuildAutoReactions } from "../../data/GuildAutoReactions";
|
import { GuildAutoReactions } from "../../data/GuildAutoReactions";
|
||||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||||
|
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||||
import { trimPluginDescription } from "../../utils";
|
import { trimPluginDescription } from "../../utils";
|
||||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||||
|
@ -31,6 +32,7 @@ export const AutoReactionsPlugin = zeppelinGuildPlugin<AutoReactionsPluginType>(
|
||||||
description: trimPluginDescription(`
|
description: trimPluginDescription(`
|
||||||
Allows setting up automatic reactions to all new messages on a channel
|
Allows setting up automatic reactions to all new messages on a channel
|
||||||
`),
|
`),
|
||||||
|
configSchema: ConfigSchema,
|
||||||
},
|
},
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
|
@ -38,7 +40,7 @@ export const AutoReactionsPlugin = zeppelinGuildPlugin<AutoReactionsPluginType>(
|
||||||
LogsPlugin,
|
LogsPlugin,
|
||||||
],
|
],
|
||||||
|
|
||||||
configSchema: ConfigSchema,
|
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
|
@ -59,7 +61,4 @@ export const AutoReactionsPlugin = zeppelinGuildPlugin<AutoReactionsPluginType>(
|
||||||
state.autoReactions = GuildAutoReactions.getGuildInstance(guild.id);
|
state.autoReactions = GuildAutoReactions.getGuildInstance(guild.id);
|
||||||
state.cache = new Map();
|
state.cache = new Map();
|
||||||
},
|
},
|
||||||
|
|
||||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
|
||||||
configParser: (o: any) => o,
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import * as t from "io-ts";
|
||||||
import { configUtils, CooldownManager } from "knub";
|
import { configUtils, CooldownManager } from "knub";
|
||||||
import { GuildAntiraidLevels } from "../../data/GuildAntiraidLevels";
|
import { GuildAntiraidLevels } from "../../data/GuildAntiraidLevels";
|
||||||
import { GuildArchives } from "../../data/GuildArchives";
|
import { GuildArchives } from "../../data/GuildArchives";
|
||||||
|
@ -8,7 +9,7 @@ import { discardRegExpRunner, getRegExpRunner } from "../../regExpRunners";
|
||||||
import { MINUTES, SECONDS } from "../../utils";
|
import { MINUTES, SECONDS } from "../../utils";
|
||||||
import { registerEventListenersFromMap } from "../../utils/registerEventListenersFromMap";
|
import { registerEventListenersFromMap } from "../../utils/registerEventListenersFromMap";
|
||||||
import { unregisterEventListenersFromMap } from "../../utils/unregisterEventListenersFromMap";
|
import { unregisterEventListenersFromMap } from "../../utils/unregisterEventListenersFromMap";
|
||||||
import { StrictValidationError } from "../../validatorUtils";
|
import { StrictValidationError, validate } from "../../validatorUtils";
|
||||||
import { CountersPlugin } from "../Counters/CountersPlugin";
|
import { CountersPlugin } from "../Counters/CountersPlugin";
|
||||||
import { InternalPosterPlugin } from "../InternalPoster/InternalPosterPlugin";
|
import { InternalPosterPlugin } from "../InternalPoster/InternalPosterPlugin";
|
||||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||||
|
@ -62,14 +63,15 @@ const defaultOptions = {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Config preprocessor to set default values for triggers and perform extra validation
|
* Config preprocessor to set default values for triggers and perform extra validation
|
||||||
|
* TODO: Separate input and output types
|
||||||
*/
|
*/
|
||||||
|
const configParser = (input: unknown) => {
|
||||||
const configParser = (options) => {
|
const rules = (input as any).rules;
|
||||||
if (options.rules) {
|
if (rules) {
|
||||||
// Loop through each rule
|
// Loop through each rule
|
||||||
for (const [name, rule] of Object.entries(options.rules)) {
|
for (const [name, rule] of Object.entries(rules)) {
|
||||||
if (rule == null) {
|
if (rule == null) {
|
||||||
delete options.rules[name];
|
delete rules[name];
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,7 +181,12 @@ const configParser = (options) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return options;
|
const error = validate(ConfigSchema, input);
|
||||||
|
if (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
|
||||||
|
return input as t.TypeOf<typeof ConfigSchema>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const AutomodPlugin = zeppelinGuildPlugin<AutomodPluginType>()({
|
export const AutomodPlugin = zeppelinGuildPlugin<AutomodPluginType>()({
|
||||||
|
@ -188,7 +195,6 @@ export const AutomodPlugin = zeppelinGuildPlugin<AutomodPluginType>()({
|
||||||
info: pluginInfo,
|
info: pluginInfo,
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
// @ts-expect-error
|
|
||||||
dependencies: () => [
|
dependencies: () => [
|
||||||
LogsPlugin,
|
LogsPlugin,
|
||||||
ModActionsPlugin,
|
ModActionsPlugin,
|
||||||
|
@ -198,7 +204,6 @@ export const AutomodPlugin = zeppelinGuildPlugin<AutomodPluginType>()({
|
||||||
InternalPosterPlugin,
|
InternalPosterPlugin,
|
||||||
],
|
],
|
||||||
|
|
||||||
configSchema: ConfigSchema,
|
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
configParser,
|
configParser,
|
||||||
|
|
||||||
|
@ -261,7 +266,6 @@ export const AutomodPlugin = zeppelinGuildPlugin<AutomodPluginType>()({
|
||||||
|
|
||||||
state.onMessageUpdateFn = (message) => runAutomodOnMessage(pluginData, message, true);
|
state.onMessageUpdateFn = (message) => runAutomodOnMessage(pluginData, message, true);
|
||||||
state.savedMessages.events.on("update", state.onMessageUpdateFn);
|
state.savedMessages.events.on("update", state.onMessageUpdateFn);
|
||||||
// @ts-expect-error
|
|
||||||
const countersPlugin = pluginData.getPlugin(CountersPlugin);
|
const countersPlugin = pluginData.getPlugin(CountersPlugin);
|
||||||
|
|
||||||
state.onCounterTrigger = (name, triggerName, channelId, userId) => {
|
state.onCounterTrigger = (name, triggerName, channelId, userId) => {
|
||||||
|
@ -271,9 +275,7 @@ export const AutomodPlugin = zeppelinGuildPlugin<AutomodPluginType>()({
|
||||||
state.onCounterReverseTrigger = (name, triggerName, channelId, userId) => {
|
state.onCounterReverseTrigger = (name, triggerName, channelId, userId) => {
|
||||||
runAutomodOnCounterTrigger(pluginData, name, triggerName, channelId, userId, true);
|
runAutomodOnCounterTrigger(pluginData, name, triggerName, channelId, userId, true);
|
||||||
};
|
};
|
||||||
// @ts-expect-error
|
|
||||||
countersPlugin.onCounterEvent("trigger", state.onCounterTrigger);
|
countersPlugin.onCounterEvent("trigger", state.onCounterTrigger);
|
||||||
// @ts-expect-error
|
|
||||||
countersPlugin.onCounterEvent("reverseTrigger", state.onCounterReverseTrigger);
|
countersPlugin.onCounterEvent("reverseTrigger", state.onCounterReverseTrigger);
|
||||||
|
|
||||||
const modActionsEvents = pluginData.getPlugin(ModActionsPlugin).getEventEmitter();
|
const modActionsEvents = pluginData.getPlugin(ModActionsPlugin).getEventEmitter();
|
||||||
|
@ -303,14 +305,11 @@ export const AutomodPlugin = zeppelinGuildPlugin<AutomodPluginType>()({
|
||||||
async beforeUnload(pluginData) {
|
async beforeUnload(pluginData) {
|
||||||
const { state, guild } = pluginData;
|
const { state, guild } = pluginData;
|
||||||
|
|
||||||
// @ts-expect-error
|
|
||||||
const countersPlugin = pluginData.getPlugin(CountersPlugin);
|
const countersPlugin = pluginData.getPlugin(CountersPlugin);
|
||||||
if (state.onCounterTrigger) {
|
if (state.onCounterTrigger) {
|
||||||
// @ts-expect-error
|
|
||||||
countersPlugin.offCounterEvent("trigger", state.onCounterTrigger);
|
countersPlugin.offCounterEvent("trigger", state.onCounterTrigger);
|
||||||
}
|
}
|
||||||
if (state.onCounterReverseTrigger) {
|
if (state.onCounterReverseTrigger) {
|
||||||
// @ts-expect-error
|
|
||||||
countersPlugin.offCounterEvent("reverseTrigger", state.onCounterReverseTrigger);
|
countersPlugin.offCounterEvent("reverseTrigger", state.onCounterReverseTrigger);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,9 +12,7 @@ export const AddToCounterAction = automodAction({
|
||||||
defaultConfig: {},
|
defaultConfig: {},
|
||||||
|
|
||||||
async apply({ pluginData, contexts, actionConfig, matchResult, ruleName }) {
|
async apply({ pluginData, contexts, actionConfig, matchResult, ruleName }) {
|
||||||
// @ts-expect-error
|
|
||||||
const countersPlugin = pluginData.getPlugin(CountersPlugin);
|
const countersPlugin = pluginData.getPlugin(CountersPlugin);
|
||||||
// @ts-expect-error
|
|
||||||
if (!countersPlugin.counterExists(actionConfig.counter)) {
|
if (!countersPlugin.counterExists(actionConfig.counter)) {
|
||||||
pluginData.getPlugin(LogsPlugin).logBotAlert({
|
pluginData.getPlugin(LogsPlugin).logBotAlert({
|
||||||
body: `Unknown counter \`${actionConfig.counter}\` in \`add_to_counter\` action of Automod rule \`${ruleName}\``,
|
body: `Unknown counter \`${actionConfig.counter}\` in \`add_to_counter\` action of Automod rule \`${ruleName}\``,
|
||||||
|
@ -22,7 +20,6 @@ export const AddToCounterAction = automodAction({
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-expect-error
|
|
||||||
countersPlugin.changeCounterValue(
|
countersPlugin.changeCounterValue(
|
||||||
actionConfig.counter,
|
actionConfig.counter,
|
||||||
contexts[0].message?.channel_id || null,
|
contexts[0].message?.channel_id || null,
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import { PermissionsBitField, PermissionsString } from "discord.js";
|
import { PermissionsBitField, PermissionsString } from "discord.js";
|
||||||
import * as t from "io-ts";
|
import * as t from "io-ts";
|
||||||
import { noop } from "knub/dist/utils";
|
|
||||||
import { renderTemplate, TemplateSafeValueContainer } from "../../../templateFormatter";
|
import { renderTemplate, TemplateSafeValueContainer } from "../../../templateFormatter";
|
||||||
import { isValidSnowflake, tNullable, tPartialDictionary } from "../../../utils";
|
import { isValidSnowflake, noop, tNullable, tPartialDictionary } from "../../../utils";
|
||||||
import {
|
import {
|
||||||
guildToTemplateSafeGuild,
|
guildToTemplateSafeGuild,
|
||||||
savedMessageToTemplateSafeSavedMessage,
|
savedMessageToTemplateSafeSavedMessage,
|
||||||
|
|
|
@ -12,9 +12,7 @@ export const SetCounterAction = automodAction({
|
||||||
defaultConfig: {},
|
defaultConfig: {},
|
||||||
|
|
||||||
async apply({ pluginData, contexts, actionConfig, matchResult, ruleName }) {
|
async apply({ pluginData, contexts, actionConfig, matchResult, ruleName }) {
|
||||||
// @ts-expect-error
|
|
||||||
const countersPlugin = pluginData.getPlugin(CountersPlugin);
|
const countersPlugin = pluginData.getPlugin(CountersPlugin);
|
||||||
// @ts-expect-error
|
|
||||||
if (!countersPlugin.counterExists(actionConfig.counter)) {
|
if (!countersPlugin.counterExists(actionConfig.counter)) {
|
||||||
pluginData.getPlugin(LogsPlugin).logBotAlert({
|
pluginData.getPlugin(LogsPlugin).logBotAlert({
|
||||||
body: `Unknown counter \`${actionConfig.counter}\` in \`add_to_counter\` action of Automod rule \`${ruleName}\``,
|
body: `Unknown counter \`${actionConfig.counter}\` in \`add_to_counter\` action of Automod rule \`${ruleName}\``,
|
||||||
|
@ -22,7 +20,6 @@ export const SetCounterAction = automodAction({
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-expect-error
|
|
||||||
countersPlugin.setCounterValue(
|
countersPlugin.setCounterValue(
|
||||||
actionConfig.counter,
|
actionConfig.counter,
|
||||||
contexts[0].message?.channel_id || null,
|
contexts[0].message?.channel_id || null,
|
||||||
|
|
|
@ -14,11 +14,8 @@ export async function runAutomodOnCounterTrigger(
|
||||||
) {
|
) {
|
||||||
const user = userId ? await resolveUser(pluginData.client, userId) : undefined;
|
const user = userId ? await resolveUser(pluginData.client, userId) : undefined;
|
||||||
const member = (userId && (await resolveMember(pluginData.client, pluginData.guild, userId))) || undefined;
|
const member = (userId && (await resolveMember(pluginData.client, pluginData.guild, userId))) || undefined;
|
||||||
// @ts-expect-error
|
|
||||||
const prettyCounterName = pluginData.getPlugin(CountersPlugin).getPrettyNameForCounter(counterName);
|
const prettyCounterName = pluginData.getPlugin(CountersPlugin).getPrettyNameForCounter(counterName);
|
||||||
// @ts-expect-error
|
|
||||||
const prettyTriggerName = pluginData
|
const prettyTriggerName = pluginData
|
||||||
// @ts-expect-error
|
|
||||||
.getPlugin(CountersPlugin)
|
.getPlugin(CountersPlugin)
|
||||||
.getPrettyNameForCounterTrigger(counterName, triggerName);
|
.getPrettyNameForCounterTrigger(counterName, triggerName);
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import * as t from "io-ts";
|
import * as t from "io-ts";
|
||||||
import { GuildPluginData } from "knub";
|
import { GuildPluginData } from "knub";
|
||||||
import { Awaitable } from "knub/dist/utils";
|
import { Awaitable } from "../../utils/typeUtils";
|
||||||
import { AutomodContext, AutomodPluginType } from "./types";
|
import { AutomodContext, AutomodPluginType } from "./types";
|
||||||
|
|
||||||
interface BaseAutomodTriggerMatchResult {
|
interface BaseAutomodTriggerMatchResult {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { trimPluginDescription } from "../../utils";
|
import { trimPluginDescription } from "../../utils";
|
||||||
import { ZeppelinGuildPluginBlueprint } from "../ZeppelinPluginBlueprint";
|
import { ZeppelinGuildPluginBlueprint } from "../ZeppelinPluginBlueprint";
|
||||||
|
import { ConfigSchema } from "./types";
|
||||||
|
|
||||||
export const pluginInfo: ZeppelinGuildPluginBlueprint["info"] = {
|
export const pluginInfo: ZeppelinGuildPluginBlueprint["info"] = {
|
||||||
prettyName: "Automod",
|
prettyName: "Automod",
|
||||||
|
@ -99,4 +100,5 @@ export const pluginInfo: ZeppelinGuildPluginBlueprint["info"] = {
|
||||||
{matchSummary}
|
{matchSummary}
|
||||||
~~~
|
~~~
|
||||||
`),
|
`),
|
||||||
|
configSchema: ConfigSchema,
|
||||||
};
|
};
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { AllowedGuilds } from "../../data/AllowedGuilds";
|
||||||
import { ApiPermissionAssignments } from "../../data/ApiPermissionAssignments";
|
import { ApiPermissionAssignments } from "../../data/ApiPermissionAssignments";
|
||||||
import { Configs } from "../../data/Configs";
|
import { Configs } from "../../data/Configs";
|
||||||
import { GuildArchives } from "../../data/GuildArchives";
|
import { GuildArchives } from "../../data/GuildArchives";
|
||||||
import { sendSuccessMessage } from "../../pluginUtils";
|
import { makeIoTsConfigParser, sendSuccessMessage } from "../../pluginUtils";
|
||||||
import { zeppelinGlobalPlugin } from "../ZeppelinPluginBlueprint";
|
import { zeppelinGlobalPlugin } from "../ZeppelinPluginBlueprint";
|
||||||
import { getActiveReload, resetActiveReload } from "./activeReload";
|
import { getActiveReload, resetActiveReload } from "./activeReload";
|
||||||
import { AddDashboardUserCmd } from "./commands/AddDashboardUserCmd";
|
import { AddDashboardUserCmd } from "./commands/AddDashboardUserCmd";
|
||||||
|
@ -37,7 +37,7 @@ const defaultOptions = {
|
||||||
|
|
||||||
export const BotControlPlugin = zeppelinGlobalPlugin<BotControlPluginType>()({
|
export const BotControlPlugin = zeppelinGlobalPlugin<BotControlPluginType>()({
|
||||||
name: "bot_control",
|
name: "bot_control",
|
||||||
configSchema: ConfigSchema,
|
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
|
@ -82,7 +82,4 @@ export const BotControlPlugin = zeppelinGlobalPlugin<BotControlPluginType>()({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
|
||||||
configParser: (o: any) => o,
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { Case } from "../../data/entities/Case";
|
||||||
import { GuildArchives } from "../../data/GuildArchives";
|
import { GuildArchives } from "../../data/GuildArchives";
|
||||||
import { GuildCases } from "../../data/GuildCases";
|
import { GuildCases } from "../../data/GuildCases";
|
||||||
import { GuildLogs } from "../../data/GuildLogs";
|
import { GuildLogs } from "../../data/GuildLogs";
|
||||||
import { mapToPublicFn } from "../../pluginUtils";
|
import { makeIoTsConfigParser, mapToPublicFn } from "../../pluginUtils";
|
||||||
import { trimPluginDescription } from "../../utils";
|
import { trimPluginDescription } from "../../utils";
|
||||||
import { InternalPosterPlugin } from "../InternalPoster/InternalPosterPlugin";
|
import { InternalPosterPlugin } from "../InternalPoster/InternalPosterPlugin";
|
||||||
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
||||||
|
@ -18,6 +18,11 @@ import { getTotalCasesByMod } from "./functions/getTotalCasesByMod";
|
||||||
import { postCaseToCaseLogChannel } from "./functions/postToCaseLogChannel";
|
import { postCaseToCaseLogChannel } from "./functions/postToCaseLogChannel";
|
||||||
import { CaseArgs, CaseNoteArgs, CasesPluginType, ConfigSchema } from "./types";
|
import { CaseArgs, CaseNoteArgs, CasesPluginType, ConfigSchema } from "./types";
|
||||||
|
|
||||||
|
// The `any` cast here is to prevent TypeScript from locking up from the circular dependency
|
||||||
|
function getLogsPlugin(): Promise<any> {
|
||||||
|
return import("../Logs/LogsPlugin.js") as Promise<any>;
|
||||||
|
}
|
||||||
|
|
||||||
const defaultOptions = {
|
const defaultOptions = {
|
||||||
config: {
|
config: {
|
||||||
log_automatic_actions: true,
|
log_automatic_actions: true,
|
||||||
|
@ -37,15 +42,11 @@ export const CasesPlugin = zeppelinGuildPlugin<CasesPluginType>()({
|
||||||
description: trimPluginDescription(`
|
description: trimPluginDescription(`
|
||||||
This plugin contains basic configuration for cases created by other plugins
|
This plugin contains basic configuration for cases created by other plugins
|
||||||
`),
|
`),
|
||||||
|
configSchema: ConfigSchema,
|
||||||
},
|
},
|
||||||
|
|
||||||
dependencies: async () => [
|
dependencies: async () => [TimeAndDatePlugin, InternalPosterPlugin, (await getLogsPlugin()).LogsPlugin],
|
||||||
TimeAndDatePlugin,
|
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||||
InternalPosterPlugin,
|
|
||||||
// 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,
|
defaultOptions,
|
||||||
|
|
||||||
public: {
|
public: {
|
||||||
|
@ -87,7 +88,4 @@ export const CasesPlugin = zeppelinGuildPlugin<CasesPluginType>()({
|
||||||
state.archives = GuildArchives.getGuildInstance(guild.id);
|
state.archives = GuildArchives.getGuildInstance(guild.id);
|
||||||
state.cases = GuildCases.getGuildInstance(guild.id);
|
state.cases = GuildCases.getGuildInstance(guild.id);
|
||||||
},
|
},
|
||||||
|
|
||||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
|
||||||
configParser: (o: any) => o,
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { GuildPluginData } from "knub";
|
import { GuildPluginData } from "knub";
|
||||||
import { splitMessageIntoChunks } from "knub/dist/helpers";
|
import { splitMessageIntoChunks } from "knub/helpers";
|
||||||
import moment from "moment-timezone";
|
import moment from "moment-timezone";
|
||||||
import { Case } from "../../../data/entities/Case";
|
import { Case } from "../../../data/entities/Case";
|
||||||
import { convertDelayStringToMS, DAYS, DBDateFormat, disableLinkPreviews, messageLink } from "../../../utils";
|
import { convertDelayStringToMS, DAYS, DBDateFormat, disableLinkPreviews, messageLink } from "../../../utils";
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions } from "knub";
|
||||||
import { GuildLogs } from "../../data/GuildLogs";
|
import { GuildLogs } from "../../data/GuildLogs";
|
||||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||||
|
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||||
import { discardRegExpRunner, getRegExpRunner } from "../../regExpRunners";
|
import { discardRegExpRunner, getRegExpRunner } from "../../regExpRunners";
|
||||||
import { trimPluginDescription } from "../../utils";
|
import { trimPluginDescription } from "../../utils";
|
||||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||||
|
@ -53,10 +54,11 @@ export const CensorPlugin = zeppelinGuildPlugin<CensorPluginType>()({
|
||||||
For more advanced filtering, check out the Automod plugin!
|
For more advanced filtering, check out the Automod plugin!
|
||||||
`),
|
`),
|
||||||
legacy: true,
|
legacy: true,
|
||||||
|
configSchema: ConfigSchema,
|
||||||
},
|
},
|
||||||
|
|
||||||
dependencies: () => [LogsPlugin],
|
dependencies: () => [LogsPlugin],
|
||||||
configSchema: ConfigSchema,
|
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
|
|
||||||
beforeLoad(pluginData) {
|
beforeLoad(pluginData) {
|
||||||
|
@ -86,7 +88,4 @@ export const CensorPlugin = zeppelinGuildPlugin<CensorPluginType>()({
|
||||||
state.savedMessages.events.off("create", state.onMessageCreateFn);
|
state.savedMessages.events.off("create", state.onMessageCreateFn);
|
||||||
state.savedMessages.events.off("update", state.onMessageUpdateFn);
|
state.savedMessages.events.off("update", state.onMessageUpdateFn);
|
||||||
},
|
},
|
||||||
|
|
||||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
|
||||||
configParser: (o: any) => o,
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,21 +1,21 @@
|
||||||
import * as t from "io-ts";
|
import * as t from "io-ts";
|
||||||
|
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||||
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||||
import { ArchiveChannelCmd } from "./commands/ArchiveChannelCmd";
|
import { ArchiveChannelCmd } from "./commands/ArchiveChannelCmd";
|
||||||
import { ChannelArchiverPluginType } from "./types";
|
import { ChannelArchiverPluginType } from "./types";
|
||||||
|
|
||||||
|
const ConfigSchema = t.type({});
|
||||||
|
|
||||||
export const ChannelArchiverPlugin = zeppelinGuildPlugin<ChannelArchiverPluginType>()({
|
export const ChannelArchiverPlugin = zeppelinGuildPlugin<ChannelArchiverPluginType>()({
|
||||||
name: "channel_archiver",
|
name: "channel_archiver",
|
||||||
showInDocs: false,
|
showInDocs: false,
|
||||||
|
|
||||||
dependencies: () => [TimeAndDatePlugin],
|
dependencies: () => [TimeAndDatePlugin],
|
||||||
configSchema: t.type({}),
|
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
messageCommands: [
|
messageCommands: [
|
||||||
ArchiveChannelCmd,
|
ArchiveChannelCmd,
|
||||||
],
|
],
|
||||||
|
|
||||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
|
||||||
configParser: (o: any) => o,
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { CooldownManager } from "knub";
|
import { CooldownManager } from "knub";
|
||||||
import { GuildLogs } from "../../data/GuildLogs";
|
import { GuildLogs } from "../../data/GuildLogs";
|
||||||
|
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||||
import { trimPluginDescription } from "../../utils";
|
import { trimPluginDescription } from "../../utils";
|
||||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||||
|
@ -22,10 +23,11 @@ export const CompanionChannelsPlugin = zeppelinGuildPlugin<CompanionChannelsPlug
|
||||||
Once set up, any time a user joins one of the specified voice channels,
|
Once set up, any time a user joins one of the specified voice channels,
|
||||||
they'll get channel permissions applied to them for the text channels.
|
they'll get channel permissions applied to them for the text channels.
|
||||||
`),
|
`),
|
||||||
|
configSchema: ConfigSchema,
|
||||||
},
|
},
|
||||||
|
|
||||||
dependencies: () => [LogsPlugin],
|
dependencies: () => [LogsPlugin],
|
||||||
configSchema: ConfigSchema,
|
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
|
|
||||||
events: [VoiceStateUpdateEvt],
|
events: [VoiceStateUpdateEvt],
|
||||||
|
@ -37,7 +39,4 @@ export const CompanionChannelsPlugin = zeppelinGuildPlugin<CompanionChannelsPlug
|
||||||
afterLoad(pluginData) {
|
afterLoad(pluginData) {
|
||||||
pluginData.state.serverLogs = new GuildLogs(pluginData.guild.id);
|
pluginData.state.serverLogs = new GuildLogs(pluginData.guild.id);
|
||||||
},
|
},
|
||||||
|
|
||||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
|
||||||
configParser: (o: any) => o,
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions } from "knub";
|
||||||
import { GuildContextMenuLinks } from "../../data/GuildContextMenuLinks";
|
import { GuildContextMenuLinks } from "../../data/GuildContextMenuLinks";
|
||||||
|
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||||
import { MutesPlugin } from "../Mutes/MutesPlugin";
|
import { MutesPlugin } from "../Mutes/MutesPlugin";
|
||||||
import { UtilityPlugin } from "../Utility/UtilityPlugin";
|
import { UtilityPlugin } from "../Utility/UtilityPlugin";
|
||||||
|
@ -35,8 +36,8 @@ export const ContextMenuPlugin = zeppelinGuildPlugin<ContextMenuPluginType>()({
|
||||||
name: "context_menu",
|
name: "context_menu",
|
||||||
showInDocs: false,
|
showInDocs: false,
|
||||||
|
|
||||||
configSchema: ConfigSchema,
|
|
||||||
dependencies: () => [MutesPlugin, LogsPlugin, UtilityPlugin],
|
dependencies: () => [MutesPlugin, LogsPlugin, UtilityPlugin],
|
||||||
|
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
|
@ -53,7 +54,4 @@ export const ContextMenuPlugin = zeppelinGuildPlugin<ContextMenuPluginType>()({
|
||||||
afterLoad(pluginData) {
|
afterLoad(pluginData) {
|
||||||
loadAllCommands(pluginData);
|
loadAllCommands(pluginData);
|
||||||
},
|
},
|
||||||
|
|
||||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
|
||||||
configParser: (o: any) => o,
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { EventEmitter } from "events";
|
import { EventEmitter } from "events";
|
||||||
|
import * as t from "io-ts";
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions } from "knub";
|
||||||
import {
|
import {
|
||||||
buildCounterConditionString,
|
buildCounterConditionString,
|
||||||
|
@ -9,7 +10,7 @@ import {
|
||||||
import { GuildCounters } from "../../data/GuildCounters";
|
import { GuildCounters } from "../../data/GuildCounters";
|
||||||
import { mapToPublicFn } from "../../pluginUtils";
|
import { mapToPublicFn } from "../../pluginUtils";
|
||||||
import { convertDelayStringToMS, MINUTES } from "../../utils";
|
import { convertDelayStringToMS, MINUTES } from "../../utils";
|
||||||
import { StrictValidationError } from "../../validatorUtils";
|
import { StrictValidationError, validate } from "../../validatorUtils";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||||
import { AddCounterCmd } from "./commands/AddCounterCmd";
|
import { AddCounterCmd } from "./commands/AddCounterCmd";
|
||||||
import { CountersListCmd } from "./commands/CountersListCmd";
|
import { CountersListCmd } from "./commands/CountersListCmd";
|
||||||
|
@ -72,12 +73,13 @@ export const CountersPlugin = zeppelinGuildPlugin<CountersPluginType>()({
|
||||||
description:
|
description:
|
||||||
"Keep track of per-user, per-channel, or global numbers and trigger specific actions based on this number",
|
"Keep track of per-user, per-channel, or global numbers and trigger specific actions based on this number",
|
||||||
configurationGuide: "See <a href='/docs/setup-guides/counters'>Counters setup guide</a>",
|
configurationGuide: "See <a href='/docs/setup-guides/counters'>Counters setup guide</a>",
|
||||||
|
configSchema: ConfigSchema,
|
||||||
},
|
},
|
||||||
|
|
||||||
configSchema: ConfigSchema,
|
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
configParser: (options) => {
|
// TODO: Separate input and output types
|
||||||
for (const [counterName, counter] of Object.entries(options.counters || {})) {
|
configParser: (input) => {
|
||||||
|
for (const [counterName, counter] of Object.entries<any>((input as any).counters || {})) {
|
||||||
counter.name = counterName;
|
counter.name = counterName;
|
||||||
counter.per_user = counter.per_user ?? false;
|
counter.per_user = counter.per_user ?? false;
|
||||||
counter.per_channel = counter.per_channel ?? false;
|
counter.per_channel = counter.per_channel ?? false;
|
||||||
|
@ -90,7 +92,7 @@ export const CountersPlugin = zeppelinGuildPlugin<CountersPluginType>()({
|
||||||
|
|
||||||
// Normalize triggers
|
// Normalize triggers
|
||||||
for (const [triggerName, trigger] of Object.entries(counter.triggers)) {
|
for (const [triggerName, trigger] of Object.entries(counter.triggers)) {
|
||||||
const triggerObj: Partial<TTrigger> = typeof trigger === "string" ? { condition: trigger } : trigger;
|
const triggerObj = (typeof trigger === "string" ? { condition: trigger } : trigger) as Partial<TTrigger>;
|
||||||
|
|
||||||
triggerObj.name = triggerName;
|
triggerObj.name = triggerName;
|
||||||
const parsedCondition = parseCounterConditionString(triggerObj.condition || "");
|
const parsedCondition = parseCounterConditionString(triggerObj.condition || "");
|
||||||
|
@ -109,12 +111,16 @@ export const CountersPlugin = zeppelinGuildPlugin<CountersPluginType>()({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Object.values(options.counters || {}).length > MAX_COUNTERS) {
|
if (Object.values((input as any).counters || {}).length > MAX_COUNTERS) {
|
||||||
throw new StrictValidationError([`You can only have at most ${MAX_COUNTERS} counters`]);
|
throw new StrictValidationError([`You can only have at most ${MAX_COUNTERS} counters`]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: Any typing
|
const error = validate(ConfigSchema, input);
|
||||||
return <any>options;
|
if (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
|
||||||
|
return input as t.TypeOf<typeof ConfigSchema>;
|
||||||
},
|
},
|
||||||
|
|
||||||
public: {
|
public: {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Snowflake, TextChannel } from "discord.js";
|
import { Snowflake, TextChannel } from "discord.js";
|
||||||
import { guildPluginMessageCommand } from "knub";
|
import { guildPluginMessageCommand } from "knub";
|
||||||
import { waitForReply } from "knub/dist/helpers";
|
import { waitForReply } from "knub/helpers";
|
||||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||||
import { sendErrorMessage } from "../../../pluginUtils";
|
import { sendErrorMessage } from "../../../pluginUtils";
|
||||||
import { resolveUser, UnknownUser } from "../../../utils";
|
import { resolveUser, UnknownUser } from "../../../utils";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Snowflake, TextChannel } from "discord.js";
|
import { Snowflake, TextChannel } from "discord.js";
|
||||||
import { guildPluginMessageCommand } from "knub";
|
import { guildPluginMessageCommand } from "knub";
|
||||||
import { waitForReply } from "knub/dist/helpers";
|
import { waitForReply } from "knub/helpers";
|
||||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||||
import { sendErrorMessage } from "../../../pluginUtils";
|
import { sendErrorMessage } from "../../../pluginUtils";
|
||||||
import { resolveUser, UnknownUser } from "../../../utils";
|
import { resolveUser, UnknownUser } from "../../../utils";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Snowflake, TextChannel } from "discord.js";
|
import { Snowflake, TextChannel } from "discord.js";
|
||||||
import { guildPluginMessageCommand } from "knub";
|
import { guildPluginMessageCommand } from "knub";
|
||||||
import { waitForReply } from "knub/dist/helpers";
|
import { waitForReply } from "knub/helpers";
|
||||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||||
import { sendErrorMessage } from "../../../pluginUtils";
|
import { sendErrorMessage } from "../../../pluginUtils";
|
||||||
import { resolveUser, UnknownUser } from "../../../utils";
|
import { resolveUser, UnknownUser } from "../../../utils";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Snowflake } from "discord.js";
|
import { Snowflake } from "discord.js";
|
||||||
import { guildPluginMessageCommand } from "knub";
|
import { guildPluginMessageCommand } from "knub";
|
||||||
import { waitForReply } from "knub/dist/helpers";
|
import { waitForReply } from "knub/helpers";
|
||||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||||
import { sendErrorMessage } from "../../../pluginUtils";
|
import { sendErrorMessage } from "../../../pluginUtils";
|
||||||
import { resolveUser, UnknownUser } from "../../../utils";
|
import { resolveUser, UnknownUser } from "../../../utils";
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { GuildChannel, GuildMember, User } from "discord.js";
|
import { GuildChannel, GuildMember, User } from "discord.js";
|
||||||
import { guildPluginMessageCommand, parseSignature } from "knub";
|
import { guildPluginMessageCommand, parseSignature } from "knub";
|
||||||
import { commandTypes } from "../../commandTypes";
|
import { commandTypes } from "../../commandTypes";
|
||||||
|
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||||
import { createTypedTemplateSafeValueContainer, TemplateSafeValueContainer } from "../../templateFormatter";
|
import { createTypedTemplateSafeValueContainer, TemplateSafeValueContainer } from "../../templateFormatter";
|
||||||
import { UnknownUser } from "../../utils";
|
import { UnknownUser } from "../../utils";
|
||||||
import { isScalar } from "../../utils/isScalar";
|
import { isScalar } from "../../utils/isScalar";
|
||||||
|
@ -24,7 +25,7 @@ export const CustomEventsPlugin = zeppelinGuildPlugin<CustomEventsPluginType>()(
|
||||||
name: "custom_events",
|
name: "custom_events",
|
||||||
showInDocs: false,
|
showInDocs: false,
|
||||||
|
|
||||||
configSchema: ConfigSchema,
|
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
|
|
||||||
afterLoad(pluginData) {
|
afterLoad(pluginData) {
|
||||||
|
@ -67,7 +68,4 @@ export const CustomEventsPlugin = zeppelinGuildPlugin<CustomEventsPluginType>()(
|
||||||
beforeUnload() {
|
beforeUnload() {
|
||||||
// TODO: Run clearTriggers() once we actually have something there
|
// TODO: Run clearTriggers() once we actually have something there
|
||||||
},
|
},
|
||||||
|
|
||||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
|
||||||
configParser: (o: any) => o,
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -4,6 +4,7 @@ import { BasePluginType, GlobalPluginData, globalPluginEventListener } from "knu
|
||||||
import { AllowedGuilds } from "../../data/AllowedGuilds";
|
import { AllowedGuilds } from "../../data/AllowedGuilds";
|
||||||
import { Configs } from "../../data/Configs";
|
import { Configs } from "../../data/Configs";
|
||||||
import { env } from "../../env";
|
import { env } from "../../env";
|
||||||
|
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||||
import { zeppelinGlobalPlugin } from "../ZeppelinPluginBlueprint";
|
import { zeppelinGlobalPlugin } from "../ZeppelinPluginBlueprint";
|
||||||
|
|
||||||
interface GuildAccessMonitorPluginType extends BasePluginType {
|
interface GuildAccessMonitorPluginType extends BasePluginType {
|
||||||
|
@ -26,7 +27,7 @@ async function checkGuild(pluginData: GlobalPluginData<GuildAccessMonitorPluginT
|
||||||
*/
|
*/
|
||||||
export const GuildAccessMonitorPlugin = zeppelinGlobalPlugin<GuildAccessMonitorPluginType>()({
|
export const GuildAccessMonitorPlugin = zeppelinGlobalPlugin<GuildAccessMonitorPluginType>()({
|
||||||
name: "guild_access_monitor",
|
name: "guild_access_monitor",
|
||||||
configSchema: t.type({}),
|
configParser: makeIoTsConfigParser(t.type({})),
|
||||||
|
|
||||||
events: [
|
events: [
|
||||||
globalPluginEventListener<GuildAccessMonitorPluginType>()({
|
globalPluginEventListener<GuildAccessMonitorPluginType>()({
|
||||||
|
@ -59,7 +60,4 @@ export const GuildAccessMonitorPlugin = zeppelinGlobalPlugin<GuildAccessMonitorP
|
||||||
checkGuild(pluginData, guild);
|
checkGuild(pluginData, guild);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
|
||||||
configParser: (o: any) => o,
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import * as t from "io-ts";
|
import * as t from "io-ts";
|
||||||
import { Configs } from "../../data/Configs";
|
import { Configs } from "../../data/Configs";
|
||||||
|
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||||
import { zeppelinGlobalPlugin } from "../ZeppelinPluginBlueprint";
|
import { zeppelinGlobalPlugin } from "../ZeppelinPluginBlueprint";
|
||||||
import { reloadChangedGuilds } from "./functions/reloadChangedGuilds";
|
import { reloadChangedGuilds } from "./functions/reloadChangedGuilds";
|
||||||
import { GuildConfigReloaderPluginType } from "./types";
|
import { GuildConfigReloaderPluginType } from "./types";
|
||||||
|
@ -8,7 +9,7 @@ export const GuildConfigReloaderPlugin = zeppelinGlobalPlugin<GuildConfigReloade
|
||||||
name: "guild_config_reloader",
|
name: "guild_config_reloader",
|
||||||
showInDocs: false,
|
showInDocs: false,
|
||||||
|
|
||||||
configSchema: t.type({}),
|
configParser: makeIoTsConfigParser(t.type({})),
|
||||||
|
|
||||||
async beforeLoad(pluginData) {
|
async beforeLoad(pluginData) {
|
||||||
const { state } = pluginData;
|
const { state } = pluginData;
|
||||||
|
@ -25,7 +26,4 @@ export const GuildConfigReloaderPlugin = zeppelinGlobalPlugin<GuildConfigReloade
|
||||||
clearTimeout(pluginData.state.nextCheckTimeout);
|
clearTimeout(pluginData.state.nextCheckTimeout);
|
||||||
pluginData.state.unloaded = true;
|
pluginData.state.unloaded = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
|
||||||
configParser: (o: any) => o,
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
import { BasePluginType } from "knub";
|
import { BasePluginType } from "knub";
|
||||||
import { Configs } from "../../data/Configs";
|
import { Configs } from "../../data/Configs";
|
||||||
import { TConfigSchema } from "../Mutes/types";
|
|
||||||
import Timeout = NodeJS.Timeout;
|
import Timeout = NodeJS.Timeout;
|
||||||
|
|
||||||
export interface GuildConfigReloaderPluginType extends BasePluginType {
|
export interface GuildConfigReloaderPluginType extends BasePluginType {
|
||||||
config: TConfigSchema;
|
config: {};
|
||||||
state: {
|
state: {
|
||||||
guildConfigs: Configs;
|
guildConfigs: Configs;
|
||||||
unloaded: boolean;
|
unloaded: boolean;
|
||||||
|
|
|
@ -3,6 +3,7 @@ import * as t from "io-ts";
|
||||||
import { guildPluginEventListener } from "knub";
|
import { guildPluginEventListener } from "knub";
|
||||||
import { AllowedGuilds } from "../../data/AllowedGuilds";
|
import { AllowedGuilds } from "../../data/AllowedGuilds";
|
||||||
import { ApiPermissionAssignments } from "../../data/ApiPermissionAssignments";
|
import { ApiPermissionAssignments } from "../../data/ApiPermissionAssignments";
|
||||||
|
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||||
import { MINUTES } from "../../utils";
|
import { MINUTES } from "../../utils";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||||
import { GuildInfoSaverPluginType } from "./types";
|
import { GuildInfoSaverPluginType } from "./types";
|
||||||
|
@ -11,7 +12,7 @@ export const GuildInfoSaverPlugin = zeppelinGuildPlugin<GuildInfoSaverPluginType
|
||||||
name: "guild_info_saver",
|
name: "guild_info_saver",
|
||||||
showInDocs: false,
|
showInDocs: false,
|
||||||
|
|
||||||
configSchema: t.type({}),
|
configParser: makeIoTsConfigParser(t.type({})),
|
||||||
|
|
||||||
events: [
|
events: [
|
||||||
guildPluginEventListener({
|
guildPluginEventListener({
|
||||||
|
@ -30,9 +31,6 @@ export const GuildInfoSaverPlugin = zeppelinGuildPlugin<GuildInfoSaverPluginType
|
||||||
beforeUnload(pluginData) {
|
beforeUnload(pluginData) {
|
||||||
clearInterval(pluginData.state.updateInterval);
|
clearInterval(pluginData.state.updateInterval);
|
||||||
},
|
},
|
||||||
|
|
||||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
|
||||||
configParser: (o: any) => o,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
async function updateGuildInfo(guild: Guild) {
|
async function updateGuildInfo(guild: Guild) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions } from "knub";
|
||||||
import { Webhooks } from "../../data/Webhooks";
|
import { Webhooks } from "../../data/Webhooks";
|
||||||
import { mapToPublicFn } from "../../pluginUtils";
|
import { makeIoTsConfigParser, mapToPublicFn } from "../../pluginUtils";
|
||||||
import { Queue } from "../../Queue";
|
import { Queue } from "../../Queue";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||||
import { editMessage } from "./functions/editMessage";
|
import { editMessage } from "./functions/editMessage";
|
||||||
|
@ -16,7 +16,7 @@ export const InternalPosterPlugin = zeppelinGuildPlugin<InternalPosterPluginType
|
||||||
name: "internal_poster",
|
name: "internal_poster",
|
||||||
showInDocs: false,
|
showInDocs: false,
|
||||||
|
|
||||||
configSchema: ConfigSchema,
|
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
|
@ -33,7 +33,4 @@ export const InternalPosterPlugin = zeppelinGuildPlugin<InternalPosterPluginType
|
||||||
state.missingPermissions = false;
|
state.missingPermissions = false;
|
||||||
state.webhookClientCache = new Map();
|
state.webhookClientCache = new Map();
|
||||||
},
|
},
|
||||||
|
|
||||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
|
||||||
configParser: (o: any) => o,
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions } from "knub";
|
||||||
import { onGuildEvent } from "../../data/GuildEvents";
|
import { onGuildEvent } from "../../data/GuildEvents";
|
||||||
import { GuildVCAlerts } from "../../data/GuildVCAlerts";
|
import { GuildVCAlerts } from "../../data/GuildVCAlerts";
|
||||||
|
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||||
import { trimPluginDescription } from "../../utils";
|
import { trimPluginDescription } from "../../utils";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||||
import { FollowCmd } from "./commands/FollowCmd";
|
import { FollowCmd } from "./commands/FollowCmd";
|
||||||
|
@ -38,9 +39,10 @@ export const LocateUserPlugin = zeppelinGuildPlugin<LocateUserPluginType>()({
|
||||||
* Instantly receive an invite to the voice channel of a user
|
* Instantly receive an invite to the voice channel of a user
|
||||||
* Be notified as soon as a user switches or joins a voice channel
|
* Be notified as soon as a user switches or joins a voice channel
|
||||||
`),
|
`),
|
||||||
|
configSchema: ConfigSchema,
|
||||||
},
|
},
|
||||||
|
|
||||||
configSchema: ConfigSchema,
|
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
|
@ -78,7 +80,4 @@ export const LocateUserPlugin = zeppelinGuildPlugin<LocateUserPluginType>()({
|
||||||
|
|
||||||
state.unregisterGuildEventListener?.();
|
state.unregisterGuildEventListener?.();
|
||||||
},
|
},
|
||||||
|
|
||||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
|
||||||
configParser: (o: any) => o,
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { GuildMember, GuildTextBasedChannel, Invite, VoiceChannel } from "discord.js";
|
import { GuildMember, GuildTextBasedChannel, Invite, VoiceChannel } from "discord.js";
|
||||||
import { GuildPluginData } from "knub";
|
import { GuildPluginData } from "knub";
|
||||||
import { getInviteLink } from "knub/dist/helpers";
|
import { getInviteLink } from "knub/helpers";
|
||||||
import { sendErrorMessage } from "../../../pluginUtils";
|
import { sendErrorMessage } from "../../../pluginUtils";
|
||||||
import { LocateUserPluginType } from "../types";
|
import { LocateUserPluginType } from "../types";
|
||||||
import { createOrReuseInvite } from "./createOrReuseInvite";
|
import { createOrReuseInvite } from "./createOrReuseInvite";
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { GuildLogs } from "../../data/GuildLogs";
|
||||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||||
import { LogType } from "../../data/LogType";
|
import { LogType } from "../../data/LogType";
|
||||||
import { logger } from "../../logger";
|
import { logger } from "../../logger";
|
||||||
import { mapToPublicFn } from "../../pluginUtils";
|
import { makeIoTsConfigParser, mapToPublicFn } from "../../pluginUtils";
|
||||||
import { discardRegExpRunner, getRegExpRunner } from "../../regExpRunners";
|
import { discardRegExpRunner, getRegExpRunner } from "../../regExpRunners";
|
||||||
import { createTypedTemplateSafeValueContainer, TypedTemplateSafeValueContainer } from "../../templateFormatter";
|
import { createTypedTemplateSafeValueContainer, TypedTemplateSafeValueContainer } from "../../templateFormatter";
|
||||||
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
||||||
|
@ -110,6 +110,11 @@ import { logVoiceChannelJoin } from "./logFunctions/logVoiceChannelJoin";
|
||||||
import { logVoiceChannelLeave } from "./logFunctions/logVoiceChannelLeave";
|
import { logVoiceChannelLeave } from "./logFunctions/logVoiceChannelLeave";
|
||||||
import { logVoiceChannelMove } from "./logFunctions/logVoiceChannelMove";
|
import { logVoiceChannelMove } from "./logFunctions/logVoiceChannelMove";
|
||||||
|
|
||||||
|
// The `any` cast here is to prevent TypeScript from locking up from the circular dependency
|
||||||
|
function getCasesPlugin(): Promise<any> {
|
||||||
|
return import("../Cases/CasesPlugin.js") as Promise<any>;
|
||||||
|
}
|
||||||
|
|
||||||
const defaultOptions: PluginOptions<LogsPluginType> = {
|
const defaultOptions: PluginOptions<LogsPluginType> = {
|
||||||
config: {
|
config: {
|
||||||
channels: {},
|
channels: {},
|
||||||
|
@ -138,15 +143,11 @@ export const LogsPlugin = zeppelinGuildPlugin<LogsPluginType>()({
|
||||||
showInDocs: true,
|
showInDocs: true,
|
||||||
info: {
|
info: {
|
||||||
prettyName: "Logs",
|
prettyName: "Logs",
|
||||||
|
configSchema: ConfigSchema,
|
||||||
},
|
},
|
||||||
|
|
||||||
dependencies: async () => [
|
dependencies: async () => [TimeAndDatePlugin, InternalPosterPlugin, (await getCasesPlugin()).CasesPlugin],
|
||||||
TimeAndDatePlugin,
|
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||||
InternalPosterPlugin,
|
|
||||||
// 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,
|
defaultOptions,
|
||||||
|
|
||||||
events: [
|
events: [
|
||||||
|
@ -326,7 +327,4 @@ export const LogsPlugin = zeppelinGuildPlugin<LogsPluginType>()({
|
||||||
}
|
}
|
||||||
discardRegExpRunner(`guild-${guild.id}`);
|
discardRegExpRunner(`guild-${guild.id}`);
|
||||||
},
|
},
|
||||||
|
|
||||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
|
||||||
configParser: (o: any) => o,
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { GuildTextBasedChannel, User } from "discord.js";
|
import { GuildTextBasedChannel, User } from "discord.js";
|
||||||
import { GuildPluginData } from "knub";
|
import { GuildPluginData } from "knub";
|
||||||
import { deactivateMentions, disableCodeBlocks } from "knub/dist/helpers";
|
import { deactivateMentions, disableCodeBlocks } from "knub/helpers";
|
||||||
import { resolveChannelIds } from "src/utils/resolveChannelIds";
|
import { resolveChannelIds } from "src/utils/resolveChannelIds";
|
||||||
import { SavedMessage } from "../../../data/entities/SavedMessage";
|
import { SavedMessage } from "../../../data/entities/SavedMessage";
|
||||||
import { LogType } from "../../../data/LogType";
|
import { LogType } from "../../../data/LogType";
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions } from "knub";
|
||||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||||
|
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||||
import { SaveMessagesToDBCmd } from "./commands/SaveMessagesToDB";
|
import { SaveMessagesToDBCmd } from "./commands/SaveMessagesToDB";
|
||||||
import { SavePinsToDBCmd } from "./commands/SavePinsToDB";
|
import { SavePinsToDBCmd } from "./commands/SavePinsToDB";
|
||||||
|
@ -24,7 +25,7 @@ export const MessageSaverPlugin = zeppelinGuildPlugin<MessageSaverPluginType>()(
|
||||||
name: "message_saver",
|
name: "message_saver",
|
||||||
showInDocs: false,
|
showInDocs: false,
|
||||||
|
|
||||||
configSchema: ConfigSchema,
|
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
|
@ -45,7 +46,4 @@ export const MessageSaverPlugin = zeppelinGuildPlugin<MessageSaverPluginType>()(
|
||||||
const { state, guild } = pluginData;
|
const { state, guild } = pluginData;
|
||||||
state.savedMessages = GuildSavedMessages.getGuildInstance(guild.id);
|
state.savedMessages = GuildSavedMessages.getGuildInstance(guild.id);
|
||||||
},
|
},
|
||||||
|
|
||||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
|
||||||
configParser: (o: any) => o,
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { onGuildEvent } from "../../data/GuildEvents";
|
||||||
import { GuildLogs } from "../../data/GuildLogs";
|
import { GuildLogs } from "../../data/GuildLogs";
|
||||||
import { GuildMutes } from "../../data/GuildMutes";
|
import { GuildMutes } from "../../data/GuildMutes";
|
||||||
import { GuildTempbans } from "../../data/GuildTempbans";
|
import { GuildTempbans } from "../../data/GuildTempbans";
|
||||||
import { mapToPublicFn } from "../../pluginUtils";
|
import { makeIoTsConfigParser, mapToPublicFn } from "../../pluginUtils";
|
||||||
import { Queue } from "../../Queue";
|
import { Queue } from "../../Queue";
|
||||||
import { MINUTES, trimPluginDescription } from "../../utils";
|
import { MINUTES, trimPluginDescription } from "../../utils";
|
||||||
import { CasesPlugin } from "../Cases/CasesPlugin";
|
import { CasesPlugin } from "../Cases/CasesPlugin";
|
||||||
|
@ -120,10 +120,11 @@ export const ModActionsPlugin = zeppelinGuildPlugin<ModActionsPluginType>()({
|
||||||
description: trimPluginDescription(`
|
description: trimPluginDescription(`
|
||||||
This plugin contains the 'typical' mod actions such as warning, muting, kicking, banning, etc.
|
This plugin contains the 'typical' mod actions such as warning, muting, kicking, banning, etc.
|
||||||
`),
|
`),
|
||||||
|
configSchema: ConfigSchema,
|
||||||
},
|
},
|
||||||
|
|
||||||
dependencies: () => [TimeAndDatePlugin, CasesPlugin, MutesPlugin, LogsPlugin],
|
dependencies: () => [TimeAndDatePlugin, CasesPlugin, MutesPlugin, LogsPlugin],
|
||||||
configSchema: ConfigSchema,
|
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
|
|
||||||
events: [CreateBanCaseOnManualBanEvt, CreateUnbanCaseOnManualUnbanEvt, PostAlertOnMemberJoinEvt],
|
events: [CreateBanCaseOnManualBanEvt, CreateUnbanCaseOnManualUnbanEvt, PostAlertOnMemberJoinEvt],
|
||||||
|
@ -223,7 +224,4 @@ export const ModActionsPlugin = zeppelinGuildPlugin<ModActionsPluginType>()({
|
||||||
state.unregisterGuildEventListener?.();
|
state.unregisterGuildEventListener?.();
|
||||||
state.events.removeAllListeners();
|
state.events.removeAllListeners();
|
||||||
},
|
},
|
||||||
|
|
||||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
|
||||||
configParser: (o: any) => o,
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import humanizeDuration from "humanize-duration";
|
import humanizeDuration from "humanize-duration";
|
||||||
import { getMemberLevel } from "knub/dist/helpers";
|
import { getMemberLevel } from "knub/helpers";
|
||||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||||
import { CaseTypes } from "../../../data/CaseTypes";
|
import { CaseTypes } from "../../../data/CaseTypes";
|
||||||
import { clearExpiringTempban, registerExpiringTempban } from "../../../data/loops/expiringTempbansLoop";
|
import { clearExpiringTempban, registerExpiringTempban } from "../../../data/loops/expiringTempbansLoop";
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Snowflake } from "discord.js";
|
import { Snowflake } from "discord.js";
|
||||||
import { waitForReply } from "knub/dist/helpers";
|
import { waitForReply } from "knub/helpers";
|
||||||
import { performance } from "perf_hooks";
|
import { performance } from "perf_hooks";
|
||||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||||
import { CaseTypes } from "../../../data/CaseTypes";
|
import { CaseTypes } from "../../../data/CaseTypes";
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Snowflake } from "discord.js";
|
import { Snowflake } from "discord.js";
|
||||||
import { waitForReply } from "knub/dist/helpers";
|
import { waitForReply } from "knub/helpers";
|
||||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||||
import { CaseTypes } from "../../../data/CaseTypes";
|
import { CaseTypes } from "../../../data/CaseTypes";
|
||||||
import { LogType } from "../../../data/LogType";
|
import { LogType } from "../../../data/LogType";
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Snowflake } from "discord.js";
|
import { Snowflake } from "discord.js";
|
||||||
import { waitForReply } from "knub/dist/helpers";
|
import { waitForReply } from "knub/helpers";
|
||||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||||
import { LogType } from "../../../data/LogType";
|
import { LogType } from "../../../data/LogType";
|
||||||
import { logger } from "../../../logger";
|
import { logger } from "../../../logger";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { GuildMember, GuildTextBasedChannel } from "discord.js";
|
import { GuildMember, GuildTextBasedChannel } from "discord.js";
|
||||||
import { GuildPluginData } from "knub";
|
import { GuildPluginData } from "knub";
|
||||||
import { hasPermission } from "knub/dist/helpers";
|
import { hasPermission } from "knub/helpers";
|
||||||
import { LogType } from "../../../data/LogType";
|
import { LogType } from "../../../data/LogType";
|
||||||
import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||||
import { DAYS, errorMessage, resolveMember, resolveUser, SECONDS } from "../../../utils";
|
import { DAYS, errorMessage, resolveMember, resolveUser, SECONDS } from "../../../utils";
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { GuildCases } from "../../data/GuildCases";
|
||||||
import { onGuildEvent } from "../../data/GuildEvents";
|
import { onGuildEvent } from "../../data/GuildEvents";
|
||||||
import { GuildLogs } from "../../data/GuildLogs";
|
import { GuildLogs } from "../../data/GuildLogs";
|
||||||
import { GuildMutes } from "../../data/GuildMutes";
|
import { GuildMutes } from "../../data/GuildMutes";
|
||||||
import { mapToPublicFn } from "../../pluginUtils";
|
import { makeIoTsConfigParser, mapToPublicFn } from "../../pluginUtils";
|
||||||
import { CasesPlugin } from "../Cases/CasesPlugin";
|
import { CasesPlugin } from "../Cases/CasesPlugin";
|
||||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||||
|
@ -65,10 +65,11 @@ export const MutesPlugin = zeppelinGuildPlugin<MutesPluginType>()({
|
||||||
showInDocs: true,
|
showInDocs: true,
|
||||||
info: {
|
info: {
|
||||||
prettyName: "Mutes",
|
prettyName: "Mutes",
|
||||||
|
configSchema: ConfigSchema,
|
||||||
},
|
},
|
||||||
|
|
||||||
configSchema: ConfigSchema,
|
|
||||||
dependencies: () => [CasesPlugin, LogsPlugin],
|
dependencies: () => [CasesPlugin, LogsPlugin],
|
||||||
|
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
|
@ -126,7 +127,4 @@ export const MutesPlugin = zeppelinGuildPlugin<MutesPluginType>()({
|
||||||
state.unregisterGuildEventListener?.();
|
state.unregisterGuildEventListener?.();
|
||||||
state.events.removeAllListeners();
|
state.events.removeAllListeners();
|
||||||
},
|
},
|
||||||
|
|
||||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
|
||||||
configParser: (o: any) => o,
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions } from "knub";
|
||||||
import { GuildNicknameHistory } from "../../data/GuildNicknameHistory";
|
import { GuildNicknameHistory } from "../../data/GuildNicknameHistory";
|
||||||
import { UsernameHistory } from "../../data/UsernameHistory";
|
import { UsernameHistory } from "../../data/UsernameHistory";
|
||||||
|
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||||
import { Queue } from "../../Queue";
|
import { Queue } from "../../Queue";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||||
import { NamesCmd } from "./commands/NamesCmd";
|
import { NamesCmd } from "./commands/NamesCmd";
|
||||||
|
@ -24,7 +25,7 @@ export const NameHistoryPlugin = zeppelinGuildPlugin<NameHistoryPluginType>()({
|
||||||
name: "name_history",
|
name: "name_history",
|
||||||
showInDocs: false,
|
showInDocs: false,
|
||||||
|
|
||||||
configSchema: ConfigSchema,
|
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
|
@ -46,7 +47,4 @@ export const NameHistoryPlugin = zeppelinGuildPlugin<NameHistoryPluginType>()({
|
||||||
state.usernameHistory = new UsernameHistory();
|
state.usernameHistory = new UsernameHistory();
|
||||||
state.updateQueue = new Queue();
|
state.updateQueue = new Queue();
|
||||||
},
|
},
|
||||||
|
|
||||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
|
||||||
configParser: (o: any) => o,
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Snowflake } from "discord.js";
|
import { Snowflake } from "discord.js";
|
||||||
import { createChunkedMessage, disableCodeBlocks } from "knub/dist/helpers";
|
import { createChunkedMessage, disableCodeBlocks } from "knub/helpers";
|
||||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||||
import { NICKNAME_RETENTION_PERIOD } from "../../../data/cleanup/nicknames";
|
import { NICKNAME_RETENTION_PERIOD } from "../../../data/cleanup/nicknames";
|
||||||
import { MAX_NICKNAME_ENTRIES_PER_USER } from "../../../data/GuildNicknameHistory";
|
import { MAX_NICKNAME_ENTRIES_PER_USER } from "../../../data/GuildNicknameHistory";
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions } from "knub";
|
||||||
import { GuildLogs } from "../../data/GuildLogs";
|
import { GuildLogs } from "../../data/GuildLogs";
|
||||||
import { GuildPersistedData } from "../../data/GuildPersistedData";
|
import { GuildPersistedData } from "../../data/GuildPersistedData";
|
||||||
|
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||||
import { trimPluginDescription } from "../../utils";
|
import { trimPluginDescription } from "../../utils";
|
||||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||||
|
@ -25,10 +26,11 @@ export const PersistPlugin = zeppelinGuildPlugin<PersistPluginType>()({
|
||||||
Re-apply roles or nicknames for users when they rejoin the server.
|
Re-apply roles or nicknames for users when they rejoin the server.
|
||||||
Mute roles are re-applied automatically, this plugin is not required for that.
|
Mute roles are re-applied automatically, this plugin is not required for that.
|
||||||
`),
|
`),
|
||||||
|
configSchema: ConfigSchema,
|
||||||
},
|
},
|
||||||
|
|
||||||
dependencies: () => [LogsPlugin],
|
dependencies: () => [LogsPlugin],
|
||||||
configSchema: ConfigSchema,
|
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
|
@ -43,7 +45,4 @@ export const PersistPlugin = zeppelinGuildPlugin<PersistPluginType>()({
|
||||||
state.persistedData = GuildPersistedData.getGuildInstance(guild.id);
|
state.persistedData = GuildPersistedData.getGuildInstance(guild.id);
|
||||||
state.logs = new GuildLogs(guild.id);
|
state.logs = new GuildLogs(guild.id);
|
||||||
},
|
},
|
||||||
|
|
||||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
|
||||||
configParser: (o: any) => o,
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions } from "knub";
|
||||||
import { hasPhishermanMasterAPIKey, phishermanApiKeyIsValid } from "../../data/Phisherman";
|
import { hasPhishermanMasterAPIKey, phishermanApiKeyIsValid } from "../../data/Phisherman";
|
||||||
import { mapToPublicFn } from "../../pluginUtils";
|
import { makeIoTsConfigParser, mapToPublicFn } from "../../pluginUtils";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||||
import { getDomainInfo } from "./functions/getDomainInfo";
|
import { getDomainInfo } from "./functions/getDomainInfo";
|
||||||
import { pluginInfo } from "./info";
|
import { pluginInfo } from "./info";
|
||||||
|
@ -18,7 +18,7 @@ export const PhishermanPlugin = zeppelinGuildPlugin<PhishermanPluginType>()({
|
||||||
showInDocs: true,
|
showInDocs: true,
|
||||||
info: pluginInfo,
|
info: pluginInfo,
|
||||||
|
|
||||||
configSchema: ConfigSchema,
|
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
|
@ -49,7 +49,4 @@ export const PhishermanPlugin = zeppelinGuildPlugin<PhishermanPluginType>()({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
|
||||||
configParser: (o: any) => o,
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { trimPluginDescription } from "../../utils";
|
import { trimPluginDescription } from "../../utils";
|
||||||
import { ZeppelinGuildPluginBlueprint } from "../ZeppelinPluginBlueprint";
|
import { ZeppelinGuildPluginBlueprint } from "../ZeppelinPluginBlueprint";
|
||||||
|
import { ConfigSchema } from "./types";
|
||||||
|
|
||||||
export const pluginInfo: ZeppelinGuildPluginBlueprint["info"] = {
|
export const pluginInfo: ZeppelinGuildPluginBlueprint["info"] = {
|
||||||
prettyName: "Phisherman",
|
prettyName: "Phisherman",
|
||||||
|
@ -38,4 +39,5 @@ export const pluginInfo: ZeppelinGuildPluginBlueprint["info"] = {
|
||||||
clean: true
|
clean: true
|
||||||
~~~
|
~~~
|
||||||
`),
|
`),
|
||||||
|
configSchema: ConfigSchema,
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions } from "knub";
|
||||||
import { GuildPingableRoles } from "../../data/GuildPingableRoles";
|
import { GuildPingableRoles } from "../../data/GuildPingableRoles";
|
||||||
|
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||||
import { PingableRoleDisableCmd } from "./commands/PingableRoleDisableCmd";
|
import { PingableRoleDisableCmd } from "./commands/PingableRoleDisableCmd";
|
||||||
import { PingableRoleEnableCmd } from "./commands/PingableRoleEnableCmd";
|
import { PingableRoleEnableCmd } from "./commands/PingableRoleEnableCmd";
|
||||||
|
@ -24,9 +25,10 @@ export const PingableRolesPlugin = zeppelinGuildPlugin<PingableRolesPluginType>(
|
||||||
showInDocs: true,
|
showInDocs: true,
|
||||||
info: {
|
info: {
|
||||||
prettyName: "Pingable roles",
|
prettyName: "Pingable roles",
|
||||||
|
configSchema: ConfigSchema,
|
||||||
},
|
},
|
||||||
|
|
||||||
configSchema: ConfigSchema,
|
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
|
@ -49,7 +51,4 @@ export const PingableRolesPlugin = zeppelinGuildPlugin<PingableRolesPluginType>(
|
||||||
state.cache = new Map();
|
state.cache = new Map();
|
||||||
state.timeouts = new Map();
|
state.timeouts = new Map();
|
||||||
},
|
},
|
||||||
|
|
||||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
|
||||||
configParser: (o: any) => o,
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -3,6 +3,7 @@ import { onGuildEvent } from "../../data/GuildEvents";
|
||||||
import { GuildLogs } from "../../data/GuildLogs";
|
import { GuildLogs } from "../../data/GuildLogs";
|
||||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||||
import { GuildScheduledPosts } from "../../data/GuildScheduledPosts";
|
import { GuildScheduledPosts } from "../../data/GuildScheduledPosts";
|
||||||
|
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||||
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||||
|
@ -35,10 +36,11 @@ export const PostPlugin = zeppelinGuildPlugin<PostPluginType>()({
|
||||||
showInDocs: true,
|
showInDocs: true,
|
||||||
info: {
|
info: {
|
||||||
prettyName: "Post",
|
prettyName: "Post",
|
||||||
|
configSchema: ConfigSchema,
|
||||||
},
|
},
|
||||||
|
|
||||||
dependencies: () => [TimeAndDatePlugin, LogsPlugin],
|
dependencies: () => [TimeAndDatePlugin, LogsPlugin],
|
||||||
configSchema: ConfigSchema,
|
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
|
@ -73,7 +75,4 @@ export const PostPlugin = zeppelinGuildPlugin<PostPluginType>()({
|
||||||
|
|
||||||
state.unregisterGuildEventListener?.();
|
state.unregisterGuildEventListener?.();
|
||||||
},
|
},
|
||||||
|
|
||||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
|
||||||
configParser: (o: any) => o,
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions } from "knub";
|
||||||
import { GuildReactionRoles } from "../../data/GuildReactionRoles";
|
import { GuildReactionRoles } from "../../data/GuildReactionRoles";
|
||||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||||
|
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||||
import { Queue } from "../../Queue";
|
import { Queue } from "../../Queue";
|
||||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||||
|
@ -39,10 +40,11 @@ export const ReactionRolesPlugin = zeppelinGuildPlugin<ReactionRolesPluginType>(
|
||||||
info: {
|
info: {
|
||||||
prettyName: "Reaction roles",
|
prettyName: "Reaction roles",
|
||||||
legacy: "Consider using the [Role buttons](/docs/plugins/role_buttons) plugin instead.",
|
legacy: "Consider using the [Role buttons](/docs/plugins/role_buttons) plugin instead.",
|
||||||
|
configSchema: ConfigSchema,
|
||||||
},
|
},
|
||||||
|
|
||||||
dependencies: () => [LogsPlugin],
|
dependencies: () => [LogsPlugin],
|
||||||
configSchema: ConfigSchema,
|
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
|
@ -85,7 +87,4 @@ export const ReactionRolesPlugin = zeppelinGuildPlugin<ReactionRolesPluginType>(
|
||||||
clearTimeout(state.autoRefreshTimeout);
|
clearTimeout(state.autoRefreshTimeout);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
|
||||||
configParser: (o: any) => o,
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions } from "knub";
|
||||||
import { onGuildEvent } from "../../data/GuildEvents";
|
import { onGuildEvent } from "../../data/GuildEvents";
|
||||||
import { GuildReminders } from "../../data/GuildReminders";
|
import { GuildReminders } from "../../data/GuildReminders";
|
||||||
|
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||||
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||||
import { RemindCmd } from "./commands/RemindCmd";
|
import { RemindCmd } from "./commands/RemindCmd";
|
||||||
|
@ -28,10 +29,11 @@ export const RemindersPlugin = zeppelinGuildPlugin<RemindersPluginType>()({
|
||||||
showInDocs: true,
|
showInDocs: true,
|
||||||
info: {
|
info: {
|
||||||
prettyName: "Reminders",
|
prettyName: "Reminders",
|
||||||
|
configSchema: ConfigSchema,
|
||||||
},
|
},
|
||||||
|
|
||||||
dependencies: () => [TimeAndDatePlugin],
|
dependencies: () => [TimeAndDatePlugin],
|
||||||
configSchema: ConfigSchema,
|
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
|
@ -63,7 +65,4 @@ export const RemindersPlugin = zeppelinGuildPlugin<RemindersPluginType>()({
|
||||||
state.unregisterGuildEventListener?.();
|
state.unregisterGuildEventListener?.();
|
||||||
state.unloaded = true;
|
state.unloaded = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
|
||||||
configParser: (o: any) => o,
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { HTTPError, Snowflake } from "discord.js";
|
import { HTTPError, Snowflake } from "discord.js";
|
||||||
import { GuildPluginData } from "knub";
|
import { GuildPluginData } from "knub";
|
||||||
import { disableLinkPreviews } from "knub/dist/helpers";
|
import { disableLinkPreviews } from "knub/helpers";
|
||||||
import moment from "moment-timezone";
|
import moment from "moment-timezone";
|
||||||
import { Reminder } from "../../../data/entities/Reminder";
|
import { Reminder } from "../../../data/entities/Reminder";
|
||||||
import { DBDateFormat } from "../../../utils";
|
import { DBDateFormat } from "../../../utils";
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
|
import * as t from "io-ts";
|
||||||
import { GuildRoleButtons } from "../../data/GuildRoleButtons";
|
import { GuildRoleButtons } from "../../data/GuildRoleButtons";
|
||||||
import { StrictValidationError } from "../../validatorUtils";
|
import { StrictValidationError, validate } from "../../validatorUtils";
|
||||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||||
import { RoleManagerPlugin } from "../RoleManager/RoleManagerPlugin";
|
import { RoleManagerPlugin } from "../RoleManager/RoleManagerPlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||||
|
@ -13,7 +14,6 @@ import { ConfigSchema, RoleButtonsPluginType } from "./types";
|
||||||
|
|
||||||
export const RoleButtonsPlugin = zeppelinGuildPlugin<RoleButtonsPluginType>()({
|
export const RoleButtonsPlugin = zeppelinGuildPlugin<RoleButtonsPluginType>()({
|
||||||
name: "role_buttons",
|
name: "role_buttons",
|
||||||
configSchema: ConfigSchema,
|
|
||||||
info: pluginInfo,
|
info: pluginInfo,
|
||||||
showInDocs: true,
|
showInDocs: true,
|
||||||
|
|
||||||
|
@ -32,11 +32,10 @@ export const RoleButtonsPlugin = zeppelinGuildPlugin<RoleButtonsPluginType>()({
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
configParser(options) {
|
configParser(input) {
|
||||||
// Auto-fill "name" property for buttons based on the object key
|
// Auto-fill "name" property for buttons based on the object key
|
||||||
const buttonsArray = Array.isArray(options.buttons) ? options.buttons : [];
|
|
||||||
const seenMessages = new Set();
|
const seenMessages = new Set();
|
||||||
for (const [name, buttonsConfig] of Object.entries(options.buttons ?? {})) {
|
for (const [name, buttonsConfig] of Object.entries<any>((input as any).buttons ?? {})) {
|
||||||
if (name.length > 16) {
|
if (name.length > 16) {
|
||||||
throw new StrictValidationError(["Name for role buttons can be at most 16 characters long"]);
|
throw new StrictValidationError(["Name for role buttons can be at most 16 characters long"]);
|
||||||
}
|
}
|
||||||
|
@ -66,8 +65,12 @@ export const RoleButtonsPlugin = zeppelinGuildPlugin<RoleButtonsPluginType>()({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: any typing lol
|
const error = validate(ConfigSchema, input);
|
||||||
return <any>options;
|
if (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
|
||||||
|
return input as t.TypeOf<typeof ConfigSchema>;
|
||||||
},
|
},
|
||||||
|
|
||||||
dependencies: () => [LogsPlugin, RoleManagerPlugin],
|
dependencies: () => [LogsPlugin, RoleManagerPlugin],
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { trimPluginDescription } from "../../utils";
|
import { trimPluginDescription } from "../../utils";
|
||||||
import { ZeppelinGuildPluginBlueprint } from "../ZeppelinPluginBlueprint";
|
import { ZeppelinGuildPluginBlueprint } from "../ZeppelinPluginBlueprint";
|
||||||
|
import { ConfigSchema } from "./types";
|
||||||
|
|
||||||
export const pluginInfo: ZeppelinGuildPluginBlueprint["info"] = {
|
export const pluginInfo: ZeppelinGuildPluginBlueprint["info"] = {
|
||||||
prettyName: "Role buttons",
|
prettyName: "Role buttons",
|
||||||
|
@ -77,4 +78,5 @@ export const pluginInfo: ZeppelinGuildPluginBlueprint["info"] = {
|
||||||
... # See above for examples for options
|
... # See above for examples for options
|
||||||
~~~
|
~~~
|
||||||
`),
|
`),
|
||||||
|
configSchema: ConfigSchema,
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { GuildRoleQueue } from "../../data/GuildRoleQueue";
|
import { GuildRoleQueue } from "../../data/GuildRoleQueue";
|
||||||
import { mapToPublicFn } from "../../pluginUtils";
|
import { makeIoTsConfigParser, mapToPublicFn } from "../../pluginUtils";
|
||||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||||
import { addPriorityRole } from "./functions/addPriorityRole";
|
import { addPriorityRole } from "./functions/addPriorityRole";
|
||||||
|
@ -11,10 +11,10 @@ import { ConfigSchema, RoleManagerPluginType } from "./types";
|
||||||
|
|
||||||
export const RoleManagerPlugin = zeppelinGuildPlugin<RoleManagerPluginType>()({
|
export const RoleManagerPlugin = zeppelinGuildPlugin<RoleManagerPluginType>()({
|
||||||
name: "role_manager",
|
name: "role_manager",
|
||||||
configSchema: ConfigSchema,
|
|
||||||
showInDocs: false,
|
showInDocs: false,
|
||||||
|
|
||||||
dependencies: () => [LogsPlugin],
|
dependencies: () => [LogsPlugin],
|
||||||
|
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||||
|
|
||||||
public: {
|
public: {
|
||||||
addRole: mapToPublicFn(addRole),
|
addRole: mapToPublicFn(addRole),
|
||||||
|
@ -40,7 +40,4 @@ export const RoleManagerPlugin = zeppelinGuildPlugin<RoleManagerPluginType>()({
|
||||||
state.abortRoleAssignmentLoop = true;
|
state.abortRoleAssignmentLoop = true;
|
||||||
await state.pendingRoleAssignmentPromise;
|
await state.pendingRoleAssignmentPromise;
|
||||||
},
|
},
|
||||||
|
|
||||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
|
||||||
configParser: (o: any) => o,
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions } from "knub";
|
||||||
import { GuildLogs } from "../../data/GuildLogs";
|
import { GuildLogs } from "../../data/GuildLogs";
|
||||||
|
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||||
import { trimPluginDescription } from "../../utils";
|
import { trimPluginDescription } from "../../utils";
|
||||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||||
|
@ -39,10 +40,11 @@ export const RolesPlugin = zeppelinGuildPlugin<RolesPluginType>()({
|
||||||
description: trimPluginDescription(`
|
description: trimPluginDescription(`
|
||||||
Enables authorised users to add and remove whitelisted roles with a command.
|
Enables authorised users to add and remove whitelisted roles with a command.
|
||||||
`),
|
`),
|
||||||
|
configSchema: ConfigSchema,
|
||||||
},
|
},
|
||||||
|
|
||||||
configSchema: ConfigSchema,
|
|
||||||
dependencies: () => [LogsPlugin],
|
dependencies: () => [LogsPlugin],
|
||||||
|
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
|
@ -58,7 +60,4 @@ export const RolesPlugin = zeppelinGuildPlugin<RolesPluginType>()({
|
||||||
|
|
||||||
state.logs = new GuildLogs(guild.id);
|
state.logs = new GuildLogs(guild.id);
|
||||||
},
|
},
|
||||||
|
|
||||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
|
||||||
configParser: (o: any) => o,
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
|
import * as t from "io-ts";
|
||||||
import { CooldownManager, PluginOptions } from "knub";
|
import { CooldownManager, PluginOptions } from "knub";
|
||||||
import { trimPluginDescription } from "../../utils";
|
import { trimPluginDescription } from "../../utils";
|
||||||
|
import { validate } from "../../validatorUtils";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||||
import { RoleAddCmd } from "./commands/RoleAddCmd";
|
import { RoleAddCmd } from "./commands/RoleAddCmd";
|
||||||
import { RoleHelpCmd } from "./commands/RoleHelpCmd";
|
import { RoleHelpCmd } from "./commands/RoleHelpCmd";
|
||||||
|
@ -17,9 +19,6 @@ export const SelfGrantableRolesPlugin = zeppelinGuildPlugin<SelfGrantableRolesPl
|
||||||
name: "self_grantable_roles",
|
name: "self_grantable_roles",
|
||||||
showInDocs: true,
|
showInDocs: true,
|
||||||
|
|
||||||
configSchema: ConfigSchema,
|
|
||||||
defaultOptions,
|
|
||||||
|
|
||||||
info: {
|
info: {
|
||||||
prettyName: "Self-grantable roles",
|
prettyName: "Self-grantable roles",
|
||||||
description: trimPluginDescription(`
|
description: trimPluginDescription(`
|
||||||
|
@ -68,24 +67,31 @@ export const SelfGrantableRolesPlugin = zeppelinGuildPlugin<SelfGrantableRolesPl
|
||||||
can_use: true
|
can_use: true
|
||||||
~~~
|
~~~
|
||||||
`),
|
`),
|
||||||
|
configSchema: ConfigSchema,
|
||||||
},
|
},
|
||||||
|
|
||||||
configParser: (options) => {
|
configParser: (input) => {
|
||||||
const config = options;
|
const entries = (input as any).entries;
|
||||||
for (const [key, entry] of Object.entries(config.entries)) {
|
for (const [key, entry] of Object.entries<any>(entries)) {
|
||||||
// Apply default entry config
|
// Apply default entry config
|
||||||
config.entries[key] = { ...defaultSelfGrantableRoleEntry, ...entry };
|
entries[key] = { ...defaultSelfGrantableRoleEntry, ...entry };
|
||||||
|
|
||||||
// Normalize alias names
|
// Normalize alias names
|
||||||
if (entry.roles) {
|
if (entry.roles) {
|
||||||
for (const [roleId, aliases] of Object.entries(entry.roles)) {
|
for (const [roleId, aliases] of Object.entries<string[]>(entry.roles)) {
|
||||||
entry.roles[roleId] = aliases.map((a) => a.toLowerCase());
|
entry.roles[roleId] = aliases.map((a) => a.toLowerCase());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return { ...options, config };
|
const error = validate(ConfigSchema, input);
|
||||||
|
if (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
|
||||||
|
return input as t.TypeOf<typeof ConfigSchema>;
|
||||||
},
|
},
|
||||||
|
defaultOptions,
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
messageCommands: [
|
messageCommands: [
|
||||||
|
|
|
@ -2,6 +2,7 @@ import { PluginOptions } from "knub";
|
||||||
import { GuildLogs } from "../../data/GuildLogs";
|
import { GuildLogs } from "../../data/GuildLogs";
|
||||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||||
import { GuildSlowmodes } from "../../data/GuildSlowmodes";
|
import { GuildSlowmodes } from "../../data/GuildSlowmodes";
|
||||||
|
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||||
import { SECONDS } from "../../utils";
|
import { SECONDS } from "../../utils";
|
||||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||||
|
@ -40,6 +41,7 @@ export const SlowmodePlugin = zeppelinGuildPlugin<SlowmodePluginType>()({
|
||||||
showInDocs: true,
|
showInDocs: true,
|
||||||
info: {
|
info: {
|
||||||
prettyName: "Slowmode",
|
prettyName: "Slowmode",
|
||||||
|
configSchema: ConfigSchema,
|
||||||
},
|
},
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
|
@ -47,7 +49,7 @@ export const SlowmodePlugin = zeppelinGuildPlugin<SlowmodePluginType>()({
|
||||||
LogsPlugin,
|
LogsPlugin,
|
||||||
],
|
],
|
||||||
|
|
||||||
configSchema: ConfigSchema,
|
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
|
@ -84,7 +86,4 @@ export const SlowmodePlugin = zeppelinGuildPlugin<SlowmodePluginType>()({
|
||||||
state.savedMessages.events.off("create", state.onMessageCreateFn);
|
state.savedMessages.events.off("create", state.onMessageCreateFn);
|
||||||
clearInterval(state.clearInterval);
|
clearInterval(state.clearInterval);
|
||||||
},
|
},
|
||||||
|
|
||||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
|
||||||
configParser: (o: any) => o,
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { GuildChannel, TextChannel } from "discord.js";
|
import { GuildChannel, TextChannel } from "discord.js";
|
||||||
import humanizeDuration from "humanize-duration";
|
import humanizeDuration from "humanize-duration";
|
||||||
import { createChunkedMessage } from "knub/dist/helpers";
|
import { createChunkedMessage } from "knub/helpers";
|
||||||
import { errorMessage } from "../../../utils";
|
import { errorMessage } from "../../../utils";
|
||||||
import { slowmodeCmd } from "../types";
|
import { slowmodeCmd } from "../types";
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ import { GuildArchives } from "../../data/GuildArchives";
|
||||||
import { GuildLogs } from "../../data/GuildLogs";
|
import { GuildLogs } from "../../data/GuildLogs";
|
||||||
import { GuildMutes } from "../../data/GuildMutes";
|
import { GuildMutes } from "../../data/GuildMutes";
|
||||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||||
|
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||||
import { trimPluginDescription } from "../../utils";
|
import { trimPluginDescription } from "../../utils";
|
||||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||||
|
@ -52,11 +53,11 @@ export const SpamPlugin = zeppelinGuildPlugin<SpamPluginType>()({
|
||||||
For more advanced spam filtering, check out the Automod plugin!
|
For more advanced spam filtering, check out the Automod plugin!
|
||||||
`),
|
`),
|
||||||
legacy: true,
|
legacy: true,
|
||||||
|
configSchema: ConfigSchema,
|
||||||
},
|
},
|
||||||
|
|
||||||
dependencies: () => [LogsPlugin],
|
dependencies: () => [LogsPlugin],
|
||||||
|
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||||
configSchema: ConfigSchema,
|
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
|
@ -92,7 +93,4 @@ export const SpamPlugin = zeppelinGuildPlugin<SpamPluginType>()({
|
||||||
state.savedMessages.events.off("create", state.onMessageCreateFn);
|
state.savedMessages.events.off("create", state.onMessageCreateFn);
|
||||||
clearInterval(state.expiryInterval);
|
clearInterval(state.expiryInterval);
|
||||||
},
|
},
|
||||||
|
|
||||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
|
||||||
configParser: (o: any) => o,
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
|
import * as t from "io-ts";
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions } from "knub";
|
||||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||||
import { GuildStarboardMessages } from "../../data/GuildStarboardMessages";
|
import { GuildStarboardMessages } from "../../data/GuildStarboardMessages";
|
||||||
import { GuildStarboardReactions } from "../../data/GuildStarboardReactions";
|
import { GuildStarboardReactions } from "../../data/GuildStarboardReactions";
|
||||||
import { trimPluginDescription } from "../../utils";
|
import { trimPluginDescription } from "../../utils";
|
||||||
|
import { validate } from "../../validatorUtils";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||||
import { MigratePinsCmd } from "./commands/MigratePinsCmd";
|
import { MigratePinsCmd } from "./commands/MigratePinsCmd";
|
||||||
import { StarboardReactionAddEvt } from "./events/StarboardReactionAddEvt";
|
import { StarboardReactionAddEvt } from "./events/StarboardReactionAddEvt";
|
||||||
|
@ -30,9 +32,6 @@ export const StarboardPlugin = zeppelinGuildPlugin<StarboardPluginType>()({
|
||||||
name: "starboard",
|
name: "starboard",
|
||||||
showInDocs: true,
|
showInDocs: true,
|
||||||
|
|
||||||
configSchema: ConfigSchema,
|
|
||||||
defaultOptions,
|
|
||||||
|
|
||||||
info: {
|
info: {
|
||||||
prettyName: "Starboard",
|
prettyName: "Starboard",
|
||||||
description: trimPluginDescription(`
|
description: trimPluginDescription(`
|
||||||
|
@ -122,18 +121,25 @@ export const StarboardPlugin = zeppelinGuildPlugin<StarboardPluginType>()({
|
||||||
enabled: true
|
enabled: true
|
||||||
~~~
|
~~~
|
||||||
`),
|
`),
|
||||||
|
configSchema: ConfigSchema,
|
||||||
},
|
},
|
||||||
|
|
||||||
configParser(options) {
|
configParser(input) {
|
||||||
if (options.boards) {
|
const boards = (input as any).boards;
|
||||||
for (const [name, opts] of Object.entries(options.boards)) {
|
if (boards) {
|
||||||
options.boards[name] = Object.assign({}, defaultStarboardOpts, options.boards[name]);
|
for (const [name, opts] of Object.entries(boards)) {
|
||||||
|
boards[name] = Object.assign({}, defaultStarboardOpts, boards[name]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: any typing lol
|
const error = validate(ConfigSchema, input);
|
||||||
return <any>options;
|
if (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
|
||||||
|
return input as t.TypeOf<typeof ConfigSchema>;
|
||||||
},
|
},
|
||||||
|
defaultOptions,
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
messageCommands: [
|
messageCommands: [
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
import { Snowflake } from "discord.js";
|
import { Snowflake } from "discord.js";
|
||||||
import humanizeDuration from "humanize-duration";
|
import humanizeDuration from "humanize-duration";
|
||||||
|
import * as t from "io-ts";
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions } from "knub";
|
||||||
import moment from "moment-timezone";
|
import moment from "moment-timezone";
|
||||||
import { StrictValidationError } from "src/validatorUtils";
|
import { StrictValidationError, validate } from "src/validatorUtils";
|
||||||
import { GuildArchives } from "../../data/GuildArchives";
|
import { GuildArchives } from "../../data/GuildArchives";
|
||||||
import { GuildLogs } from "../../data/GuildLogs";
|
import { GuildLogs } from "../../data/GuildLogs";
|
||||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||||
|
@ -71,9 +72,9 @@ export const TagsPlugin = zeppelinGuildPlugin<TagsPluginType>()({
|
||||||
|
|
||||||
${generateTemplateMarkdown(TemplateFunctions)}
|
${generateTemplateMarkdown(TemplateFunctions)}
|
||||||
`),
|
`),
|
||||||
|
configSchema: ConfigSchema,
|
||||||
},
|
},
|
||||||
|
|
||||||
configSchema: ConfigSchema,
|
|
||||||
dependencies: () => [LogsPlugin],
|
dependencies: () => [LogsPlugin],
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
|
|
||||||
|
@ -96,17 +97,19 @@ export const TagsPlugin = zeppelinGuildPlugin<TagsPluginType>()({
|
||||||
findTagByName: mapToPublicFn(findTagByName),
|
findTagByName: mapToPublicFn(findTagByName),
|
||||||
},
|
},
|
||||||
|
|
||||||
configParser(options) {
|
configParser(_input) {
|
||||||
if (options.delete_with_command && options.auto_delete_command) {
|
const input = _input as any;
|
||||||
|
|
||||||
|
if (input.delete_with_command && input.auto_delete_command) {
|
||||||
throw new StrictValidationError([
|
throw new StrictValidationError([
|
||||||
`Cannot have both (global) delete_with_command and global_delete_invoke enabled`,
|
`Cannot have both (global) delete_with_command and global_delete_invoke enabled`,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check each category for conflicting options
|
// Check each category for conflicting options
|
||||||
if (options.categories) {
|
if (input.categories) {
|
||||||
for (const [name, opts] of Object.entries(options.categories)) {
|
for (const [name, opts] of Object.entries(input.categories)) {
|
||||||
const cat = options.categories[name];
|
const cat = input.categories[name];
|
||||||
if (cat.delete_with_command && cat.auto_delete_command) {
|
if (cat.delete_with_command && cat.auto_delete_command) {
|
||||||
throw new StrictValidationError([
|
throw new StrictValidationError([
|
||||||
`Cannot have both (category specific) delete_with_command and category_delete_invoke enabled at <categories/${name}>`,
|
`Cannot have both (category specific) delete_with_command and category_delete_invoke enabled at <categories/${name}>`,
|
||||||
|
@ -115,8 +118,12 @@ export const TagsPlugin = zeppelinGuildPlugin<TagsPluginType>()({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: any typing lol
|
const error = validate(ConfigSchema, input);
|
||||||
return <any>options;
|
if (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
|
||||||
|
return input as t.TypeOf<typeof ConfigSchema>;
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeLoad(pluginData) {
|
beforeLoad(pluginData) {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import * as t from "io-ts";
|
import * as t from "io-ts";
|
||||||
import { GuildPluginData } from "knub";
|
import { ExtendedMatchParams, GuildPluginData } from "knub";
|
||||||
import { ExtendedMatchParams } from "knub/dist/config/PluginConfigManager";
|
|
||||||
import { Tag, TagsPluginType } from "../types";
|
import { Tag, TagsPluginType } from "../types";
|
||||||
|
|
||||||
export async function findTagByName(
|
export async function findTagByName(
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import { GuildMember } from "discord.js";
|
import { GuildMember } from "discord.js";
|
||||||
import escapeStringRegexp from "escape-string-regexp";
|
import escapeStringRegexp from "escape-string-regexp";
|
||||||
import { GuildPluginData } from "knub";
|
import { ExtendedMatchParams, GuildPluginData } from "knub";
|
||||||
import { ExtendedMatchParams } from "knub/dist/config/PluginConfigManager";
|
|
||||||
import { StrictMessageContent } from "../../../utils";
|
import { StrictMessageContent } from "../../../utils";
|
||||||
import { TagsPluginType, TTagCategory } from "../types";
|
import { TagsPluginType, TTagCategory } from "../types";
|
||||||
import { renderTagFromString } from "./renderTagFromString";
|
import { renderTagFromString } from "./renderTagFromString";
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import { GuildPluginData } from "knub";
|
import { ExtendedMatchParams, GuildPluginData } from "knub";
|
||||||
import { ExtendedMatchParams } from "knub/dist/config/PluginConfigManager";
|
|
||||||
import { renderTemplate, TemplateSafeValue, TemplateSafeValueContainer } from "../../../templateFormatter";
|
import { renderTemplate, TemplateSafeValue, TemplateSafeValueContainer } from "../../../templateFormatter";
|
||||||
import { renderRecursively, StrictMessageContent } from "../../../utils";
|
import { renderRecursively, StrictMessageContent } from "../../../utils";
|
||||||
import { TagsPluginType, TTag } from "../types";
|
import { TagsPluginType, TTag } from "../types";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions } from "knub";
|
||||||
import { GuildMemberTimezones } from "../../data/GuildMemberTimezones";
|
import { GuildMemberTimezones } from "../../data/GuildMemberTimezones";
|
||||||
import { mapToPublicFn } from "../../pluginUtils";
|
import { makeIoTsConfigParser, mapToPublicFn } from "../../pluginUtils";
|
||||||
import { trimPluginDescription } from "../../utils";
|
import { trimPluginDescription } from "../../utils";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||||
import { ResetTimezoneCmd } from "./commands/ResetTimezoneCmd";
|
import { ResetTimezoneCmd } from "./commands/ResetTimezoneCmd";
|
||||||
|
@ -39,9 +39,10 @@ export const TimeAndDatePlugin = zeppelinGuildPlugin<TimeAndDatePluginType>()({
|
||||||
description: trimPluginDescription(`
|
description: trimPluginDescription(`
|
||||||
Allows controlling the displayed time/date formats and timezones
|
Allows controlling the displayed time/date formats and timezones
|
||||||
`),
|
`),
|
||||||
|
configSchema: ConfigSchema,
|
||||||
},
|
},
|
||||||
|
|
||||||
configSchema: ConfigSchema,
|
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
|
@ -64,7 +65,4 @@ export const TimeAndDatePlugin = zeppelinGuildPlugin<TimeAndDatePluginType>()({
|
||||||
|
|
||||||
state.memberTimezones = GuildMemberTimezones.getGuildInstance(guild.id);
|
state.memberTimezones = GuildMemberTimezones.getGuildInstance(guild.id);
|
||||||
},
|
},
|
||||||
|
|
||||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
|
||||||
configParser: (o: any) => o,
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import * as t from "io-ts";
|
import * as t from "io-ts";
|
||||||
import { UsernameHistory } from "../../data/UsernameHistory";
|
import { UsernameHistory } from "../../data/UsernameHistory";
|
||||||
|
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||||
import { Queue } from "../../Queue";
|
import { Queue } from "../../Queue";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||||
import { MessageCreateUpdateUsernameEvt, VoiceChannelJoinUpdateUsernameEvt } from "./events/UpdateUsernameEvts";
|
import { MessageCreateUpdateUsernameEvt, VoiceChannelJoinUpdateUsernameEvt } from "./events/UpdateUsernameEvts";
|
||||||
|
@ -9,7 +10,7 @@ export const UsernameSaverPlugin = zeppelinGuildPlugin<UsernameSaverPluginType>(
|
||||||
name: "username_saver",
|
name: "username_saver",
|
||||||
showInDocs: false,
|
showInDocs: false,
|
||||||
|
|
||||||
configSchema: t.type({}),
|
configParser: makeIoTsConfigParser(t.type({})),
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
events: [
|
events: [
|
||||||
|
@ -23,7 +24,4 @@ export const UsernameSaverPlugin = zeppelinGuildPlugin<UsernameSaverPluginType>(
|
||||||
state.usernameHistory = new UsernameHistory();
|
state.usernameHistory = new UsernameHistory();
|
||||||
state.updateQueue = new Queue();
|
state.updateQueue = new Queue();
|
||||||
},
|
},
|
||||||
|
|
||||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
|
||||||
configParser: (o: any) => o,
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { GuildCases } from "../../data/GuildCases";
|
||||||
import { GuildLogs } from "../../data/GuildLogs";
|
import { GuildLogs } from "../../data/GuildLogs";
|
||||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||||
import { Supporters } from "../../data/Supporters";
|
import { Supporters } from "../../data/Supporters";
|
||||||
import { sendSuccessMessage } from "../../pluginUtils";
|
import { makeIoTsConfigParser, sendSuccessMessage } from "../../pluginUtils";
|
||||||
import { discardRegExpRunner, getRegExpRunner } from "../../regExpRunners";
|
import { discardRegExpRunner, getRegExpRunner } from "../../regExpRunners";
|
||||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||||
import { ModActionsPlugin } from "../ModActions/ModActionsPlugin";
|
import { ModActionsPlugin } from "../ModActions/ModActionsPlugin";
|
||||||
|
@ -117,10 +117,11 @@ export const UtilityPlugin = zeppelinGuildPlugin<UtilityPluginType>()({
|
||||||
showInDocs: true,
|
showInDocs: true,
|
||||||
info: {
|
info: {
|
||||||
prettyName: "Utility",
|
prettyName: "Utility",
|
||||||
|
configSchema: ConfigSchema,
|
||||||
},
|
},
|
||||||
|
|
||||||
dependencies: () => [TimeAndDatePlugin, ModActionsPlugin, LogsPlugin],
|
dependencies: () => [TimeAndDatePlugin, ModActionsPlugin, LogsPlugin],
|
||||||
configSchema: ConfigSchema,
|
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
|
@ -221,7 +222,4 @@ export const UtilityPlugin = zeppelinGuildPlugin<UtilityPluginType>()({
|
||||||
beforeUnload(pluginData) {
|
beforeUnload(pluginData) {
|
||||||
discardRegExpRunner(`guild-${pluginData.guild.id}`);
|
discardRegExpRunner(`guild-${pluginData.guild.id}`);
|
||||||
},
|
},
|
||||||
|
|
||||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
|
||||||
configParser: (o: any) => o,
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import { LoadedGuildPlugin } from "knub";
|
import { LoadedGuildPlugin, PluginCommandDefinition } from "knub";
|
||||||
import { PluginCommandDefinition } from "knub/dist/commands/commandUtils";
|
|
||||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||||
import { createChunkedMessage } from "../../../utils";
|
import { createChunkedMessage } from "../../../utils";
|
||||||
import { utilityCmd } from "../types";
|
import { utilityCmd } from "../types";
|
||||||
|
@ -32,7 +31,6 @@ export const HelpCmd = utilityCmd({
|
||||||
if (strTrigger.startsWith(searchStr)) {
|
if (strTrigger.startsWith(searchStr)) {
|
||||||
matchingCommands.push({
|
matchingCommands.push({
|
||||||
plugin,
|
plugin,
|
||||||
// @ts-expect-error
|
|
||||||
command: registeredCommand,
|
command: registeredCommand,
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Snowflake } from "discord.js";
|
import { Snowflake } from "discord.js";
|
||||||
import { getChannelId, getRoleId } from "knub/dist/utils";
|
import { getChannelId, getRoleId } from "knub/helpers";
|
||||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||||
import { sendErrorMessage } from "../../../pluginUtils";
|
import { sendErrorMessage } from "../../../pluginUtils";
|
||||||
import { isValidSnowflake, noop, parseInviteCodeInput, resolveInvite, resolveUser } from "../../../utils";
|
import { isValidSnowflake, noop, parseInviteCodeInput, resolveInvite, resolveUser } from "../../../utils";
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import { APIEmbed, MessageType, Snowflake, TextChannel } from "discord.js";
|
import { APIEmbed, MessageType, Snowflake, TextChannel } from "discord.js";
|
||||||
import humanizeDuration from "humanize-duration";
|
import humanizeDuration from "humanize-duration";
|
||||||
import { GuildPluginData } from "knub";
|
import { getDefaultMessageCommandPrefix, GuildPluginData } from "knub";
|
||||||
import { getDefaultPrefix } from "knub/dist/commands/commandUtils";
|
|
||||||
import moment from "moment-timezone";
|
import moment from "moment-timezone";
|
||||||
import { chunkMessageLines, EmbedWith, messageLink, preEmbedPadding, trimEmptyLines, trimLines } from "../../../utils";
|
import { chunkMessageLines, EmbedWith, messageLink, preEmbedPadding, trimEmptyLines, trimLines } from "../../../utils";
|
||||||
import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin";
|
import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin";
|
||||||
|
@ -136,8 +135,7 @@ export async function getMessageInfoEmbed(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (message.embeds.length) {
|
if (message.embeds.length) {
|
||||||
// @ts-expect-error
|
const prefix = pluginData.fullConfig.prefix || getDefaultMessageCommandPrefix(pluginData.client);
|
||||||
const prefix = pluginData.fullConfig.prefix || getDefaultPrefix(pluginData.client);
|
|
||||||
embed.fields.push({
|
embed.fields.push({
|
||||||
name: preEmbedPadding + "Embeds",
|
name: preEmbedPadding + "Embeds",
|
||||||
value: `Message contains an embed, use \`${prefix}source\` to see the embed source`,
|
value: `Message contains an embed, use \`${prefix}source\` to see the embed source`,
|
||||||
|
|
|
@ -10,8 +10,7 @@ import {
|
||||||
User,
|
User,
|
||||||
} from "discord.js";
|
} from "discord.js";
|
||||||
import escapeStringRegexp from "escape-string-regexp";
|
import escapeStringRegexp from "escape-string-regexp";
|
||||||
import { GuildPluginData } from "knub";
|
import { ArgsFromSignatureOrArray, GuildPluginData } from "knub";
|
||||||
import { ArgsFromSignatureOrArray } from "knub/dist/commands/commandUtils";
|
|
||||||
import moment from "moment-timezone";
|
import moment from "moment-timezone";
|
||||||
import { getBaseUrl, sendErrorMessage } from "../../pluginUtils";
|
import { getBaseUrl, sendErrorMessage } from "../../pluginUtils";
|
||||||
import { allowTimeout, RegExpRunner } from "../../RegExpRunner";
|
import { allowTimeout, RegExpRunner } from "../../RegExpRunner";
|
||||||
|
@ -192,6 +191,7 @@ export async function displaySearch(
|
||||||
if (msg.author.id !== interaction.user.id) {
|
if (msg.author.id !== interaction.user.id) {
|
||||||
interaction
|
interaction
|
||||||
.reply({ content: `You are not permitted to use these buttons.`, ephemeral: true })
|
.reply({ content: `You are not permitted to use these buttons.`, ephemeral: true })
|
||||||
|
// tslint:disable-next-line no-console
|
||||||
.catch((err) => console.trace(err.message));
|
.catch((err) => console.trace(err.message));
|
||||||
} else {
|
} else {
|
||||||
if (interaction.customId === `previousButton:${idMod}` && currentPage > 1) {
|
if (interaction.customId === `previousButton:${idMod}` && currentPage > 1) {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions } from "knub";
|
||||||
import { GuildLogs } from "../../data/GuildLogs";
|
import { GuildLogs } from "../../data/GuildLogs";
|
||||||
|
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||||
import { SendWelcomeMessageEvt } from "./events/SendWelcomeMessageEvt";
|
import { SendWelcomeMessageEvt } from "./events/SendWelcomeMessageEvt";
|
||||||
|
@ -18,10 +19,11 @@ export const WelcomeMessagePlugin = zeppelinGuildPlugin<WelcomeMessagePluginType
|
||||||
showInDocs: true,
|
showInDocs: true,
|
||||||
info: {
|
info: {
|
||||||
prettyName: "Welcome message",
|
prettyName: "Welcome message",
|
||||||
|
configSchema: ConfigSchema,
|
||||||
},
|
},
|
||||||
|
|
||||||
configSchema: ConfigSchema,
|
|
||||||
dependencies: () => [LogsPlugin],
|
dependencies: () => [LogsPlugin],
|
||||||
|
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
|
@ -35,7 +37,4 @@ export const WelcomeMessagePlugin = zeppelinGuildPlugin<WelcomeMessagePluginType
|
||||||
state.logs = new GuildLogs(guild.id);
|
state.logs = new GuildLogs(guild.id);
|
||||||
state.sentWelcomeMessages = new Set();
|
state.sentWelcomeMessages = new Set();
|
||||||
},
|
},
|
||||||
|
|
||||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
|
||||||
configParser: (o: any) => o,
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -8,9 +8,6 @@ import {
|
||||||
GuildPluginBlueprint,
|
GuildPluginBlueprint,
|
||||||
GuildPluginData,
|
GuildPluginData,
|
||||||
} from "knub";
|
} from "knub";
|
||||||
import { PluginOptions } from "knub/dist/config/configTypes";
|
|
||||||
import { Awaitable } from "knub/dist/utils";
|
|
||||||
import { getPluginConfigParser } from "../pluginUtils";
|
|
||||||
import { TMarkdown } from "../types";
|
import { TMarkdown } from "../types";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -19,42 +16,30 @@ import { TMarkdown } from "../types";
|
||||||
|
|
||||||
export interface ZeppelinGuildPluginBlueprint<TPluginData extends GuildPluginData<any> = GuildPluginData<any>>
|
export interface ZeppelinGuildPluginBlueprint<TPluginData extends GuildPluginData<any> = GuildPluginData<any>>
|
||||||
extends GuildPluginBlueprint<TPluginData> {
|
extends GuildPluginBlueprint<TPluginData> {
|
||||||
configSchema: t.TypeC<any>;
|
|
||||||
showInDocs?: boolean;
|
showInDocs?: boolean;
|
||||||
|
|
||||||
info?: {
|
info?: {
|
||||||
prettyName: string;
|
prettyName: string;
|
||||||
description?: TMarkdown;
|
description?: TMarkdown;
|
||||||
usageGuide?: TMarkdown;
|
usageGuide?: TMarkdown;
|
||||||
configurationGuide?: TMarkdown;
|
configurationGuide?: TMarkdown;
|
||||||
legacy?: boolean | string;
|
legacy?: boolean | string;
|
||||||
|
configSchema?: t.Type<any>;
|
||||||
};
|
};
|
||||||
|
|
||||||
// FIXME: need proper typings here
|
|
||||||
configParser: (
|
|
||||||
options: TPluginData["_pluginType"]["config"],
|
|
||||||
strict?: boolean,
|
|
||||||
) => Awaitable<PluginOptions<TPluginData["_pluginType"]>>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function zeppelinGuildPlugin<TBlueprint extends ZeppelinGuildPluginBlueprint>(
|
export function zeppelinGuildPlugin<TBlueprint extends ZeppelinGuildPluginBlueprint>(blueprint: TBlueprint): TBlueprint;
|
||||||
blueprint: TBlueprint,
|
|
||||||
): TBlueprint & { configParser: ZeppelinGuildPluginBlueprint["configParser"] };
|
|
||||||
|
|
||||||
export function zeppelinGuildPlugin<TPluginType extends BasePluginType>(): <
|
export function zeppelinGuildPlugin<TPluginType extends BasePluginType>(): <
|
||||||
TBlueprint extends ZeppelinGuildPluginBlueprint<GuildPluginData<TPluginType>>,
|
TBlueprint extends ZeppelinGuildPluginBlueprint<GuildPluginData<TPluginType>>,
|
||||||
>(
|
>(
|
||||||
blueprint: TBlueprint,
|
blueprint: TBlueprint,
|
||||||
) => TBlueprint & {
|
) => TBlueprint;
|
||||||
configParser: ZeppelinGuildPluginBlueprint<GuildPluginData<TPluginType>>["configParser"];
|
|
||||||
};
|
|
||||||
|
|
||||||
export function zeppelinGuildPlugin(...args) {
|
export function zeppelinGuildPlugin(...args) {
|
||||||
if (args.length) {
|
if (args.length) {
|
||||||
const blueprint = guildPlugin(
|
const blueprint = guildPlugin(
|
||||||
...(args as Parameters<typeof guildPlugin>),
|
...(args as Parameters<typeof guildPlugin>),
|
||||||
) as unknown as ZeppelinGuildPluginBlueprint;
|
) as unknown as ZeppelinGuildPluginBlueprint;
|
||||||
blueprint.configParser = <any>getPluginConfigParser(blueprint, blueprint.configParser);
|
|
||||||
return blueprint;
|
return blueprint;
|
||||||
} else {
|
} else {
|
||||||
return zeppelinGuildPlugin as (name, blueprint) => ZeppelinGuildPluginBlueprint;
|
return zeppelinGuildPlugin as (name, blueprint) => ZeppelinGuildPluginBlueprint;
|
||||||
|
@ -66,31 +51,23 @@ export function zeppelinGuildPlugin(...args) {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export interface ZeppelinGlobalPluginBlueprint<TPluginType extends BasePluginType = BasePluginType>
|
export interface ZeppelinGlobalPluginBlueprint<TPluginType extends BasePluginType = BasePluginType>
|
||||||
extends GlobalPluginBlueprint<GlobalPluginData<TPluginType>> {
|
extends GlobalPluginBlueprint<GlobalPluginData<TPluginType>> {}
|
||||||
configSchema: t.TypeC<any>;
|
|
||||||
// FIXME: need proper typings here
|
|
||||||
configParser: (options: TPluginType["config"], strict?: boolean) => Awaitable<PluginOptions<TPluginType>>;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function zeppelinGlobalPlugin<TBlueprint extends ZeppelinGlobalPluginBlueprint>(
|
export function zeppelinGlobalPlugin<TBlueprint extends ZeppelinGlobalPluginBlueprint>(
|
||||||
blueprint: TBlueprint,
|
blueprint: TBlueprint,
|
||||||
): TBlueprint & { configParser: ZeppelinGlobalPluginBlueprint["configParser"] };
|
): TBlueprint;
|
||||||
|
|
||||||
export function zeppelinGlobalPlugin<TPluginType extends BasePluginType>(): <
|
export function zeppelinGlobalPlugin<TPluginType extends BasePluginType>(): <
|
||||||
TBlueprint extends ZeppelinGlobalPluginBlueprint<TPluginType>,
|
TBlueprint extends ZeppelinGlobalPluginBlueprint<TPluginType>,
|
||||||
>(
|
>(
|
||||||
blueprint: TBlueprint,
|
blueprint: TBlueprint,
|
||||||
) => TBlueprint & {
|
) => TBlueprint;
|
||||||
configParser: ZeppelinGlobalPluginBlueprint<TPluginType>["configParser"];
|
|
||||||
};
|
|
||||||
|
|
||||||
export function zeppelinGlobalPlugin(...args) {
|
export function zeppelinGlobalPlugin(...args) {
|
||||||
if (args.length) {
|
if (args.length) {
|
||||||
const blueprint = globalPlugin(
|
const blueprint = globalPlugin(
|
||||||
...(args as Parameters<typeof globalPlugin>),
|
...(args as Parameters<typeof globalPlugin>),
|
||||||
) as unknown as ZeppelinGlobalPluginBlueprint;
|
) as unknown as ZeppelinGlobalPluginBlueprint;
|
||||||
// @ts-expect-error FIXME: Check the types here
|
|
||||||
blueprint.configParser = getPluginConfigParser(blueprint, blueprint.configParser);
|
|
||||||
return blueprint;
|
return blueprint;
|
||||||
} else {
|
} else {
|
||||||
return zeppelinGlobalPlugin as (name, blueprint) => ZeppelinGlobalPluginBlueprint;
|
return zeppelinGlobalPlugin as (name, blueprint) => ZeppelinGlobalPluginBlueprint;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { Profiler } from "knub/dist/Profiler";
|
import type { Knub } from "knub";
|
||||||
|
|
||||||
|
type Profiler = Knub["profiler"];
|
||||||
let profiler: Profiler | null = null;
|
let profiler: Profiler | null = null;
|
||||||
|
|
||||||
export function getProfiler() {
|
export function getProfiler() {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Awaitable } from "knub/dist/utils";
|
import { Awaitable } from "./typeUtils";
|
||||||
|
|
||||||
export async function asyncReduce<T, V>(
|
export async function asyncReduce<T, V>(
|
||||||
arr: T[],
|
arr: T[],
|
||||||
|
|
|
@ -9,8 +9,8 @@ import {
|
||||||
TextBasedChannel,
|
TextBasedChannel,
|
||||||
User,
|
User,
|
||||||
} from "discord.js";
|
} from "discord.js";
|
||||||
import { Awaitable } from "knub/dist/utils";
|
|
||||||
import { MINUTES, noop } from "../utils";
|
import { MINUTES, noop } from "../utils";
|
||||||
|
import { Awaitable } from "./typeUtils";
|
||||||
import Timeout = NodeJS.Timeout;
|
import Timeout = NodeJS.Timeout;
|
||||||
|
|
||||||
export type LoadPageFn = (page: number) => Awaitable<MessageCreateOptions & MessageEditOptions>;
|
export type LoadPageFn = (page: number) => Awaitable<MessageCreateOptions & MessageEditOptions>;
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
import { Profiler } from "knub/dist/Profiler";
|
import type { Knub } from "knub";
|
||||||
import { performance } from "perf_hooks";
|
import { performance } from "perf_hooks";
|
||||||
import { noop, SECONDS } from "../utils";
|
import { noop, SECONDS } from "../utils";
|
||||||
|
|
||||||
|
type Profiler = Knub["profiler"];
|
||||||
|
|
||||||
let _profilingEnabled = false;
|
let _profilingEnabled = false;
|
||||||
|
|
||||||
export const profilingEnabled = () => {
|
export const profilingEnabled = () => {
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
import { GuildPluginData } from "knub";
|
import { getDefaultMessageCommandPrefix, GuildPluginData } from "knub";
|
||||||
import { getDefaultPrefix } from "knub/dist/commands/commandUtils";
|
|
||||||
|
|
||||||
export function getGuildPrefix(pluginData: GuildPluginData<any>) {
|
export function getGuildPrefix(pluginData: GuildPluginData<any>) {
|
||||||
// @ts-expect-error: discord.js version mismatch
|
return pluginData.fullConfig.prefix || getDefaultMessageCommandPrefix(pluginData.client);
|
||||||
return pluginData.fullConfig.prefix || getDefaultPrefix(pluginData.client);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,8 @@ export declare type WithRequiredProps<T, K extends keyof T> = T & {
|
||||||
// https://devblogs.microsoft.com/typescript/announcing-typescript-4-1/
|
// https://devblogs.microsoft.com/typescript/announcing-typescript-4-1/
|
||||||
export type Awaited<T> = T extends PromiseLike<infer U> ? Awaited<U> : T;
|
export type Awaited<T> = T extends PromiseLike<infer U> ? Awaited<U> : T;
|
||||||
|
|
||||||
|
export type Awaitable<T = unknown> = T | Promise<T>;
|
||||||
|
|
||||||
export type DeepMutable<T> = {
|
export type DeepMutable<T> = {
|
||||||
-readonly [P in keyof T]: DeepMutable<T[P]>;
|
-readonly [P in keyof T]: DeepMutable<T[P]>;
|
||||||
};
|
};
|
||||||
|
|
|
@ -7,9 +7,9 @@ import {
|
||||||
MessageComponentInteraction,
|
MessageComponentInteraction,
|
||||||
MessageCreateOptions,
|
MessageCreateOptions,
|
||||||
} from "discord.js";
|
} from "discord.js";
|
||||||
import { noop } from "knub/dist/utils";
|
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import uuidv4 from "uuid/v4";
|
import uuidv4 from "uuid/v4";
|
||||||
|
import { noop } from "../utils";
|
||||||
|
|
||||||
export async function waitForButtonConfirm(
|
export async function waitForButtonConfirm(
|
||||||
channel: GuildTextBasedChannel,
|
channel: GuildTextBasedChannel,
|
||||||
|
@ -37,6 +37,7 @@ export async function waitForButtonConfirm(
|
||||||
if (options?.restrictToId && options.restrictToId !== interaction.user.id) {
|
if (options?.restrictToId && options.restrictToId !== interaction.user.id) {
|
||||||
interaction
|
interaction
|
||||||
.reply({ content: `You are not permitted to use these buttons.`, ephemeral: true })
|
.reply({ content: `You are not permitted to use these buttons.`, ephemeral: true })
|
||||||
|
// tslint:disable-next-line no-console
|
||||||
.catch((err) => console.trace(err.message));
|
.catch((err) => console.trace(err.message));
|
||||||
} else {
|
} else {
|
||||||
if (interaction.customId.startsWith(`confirmButton:${idMod}:`)) {
|
if (interaction.customId.startsWith(`confirmButton:${idMod}:`)) {
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "NodeNext",
|
||||||
"module": "commonjs",
|
"module": "NodeNext",
|
||||||
"noImplicitAny": false,
|
"noImplicitAny": false,
|
||||||
"allowSyntheticDefaultImports": true,
|
"allowSyntheticDefaultImports": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"target": "es2020",
|
"target": "es2022",
|
||||||
"lib": ["esnext"],
|
"lib": ["es2022"],
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
|
|
495
package-lock.json
generated
495
package-lock.json
generated
|
@ -7,9 +7,6 @@
|
||||||
"": {
|
"": {
|
||||||
"name": "@zeppelin/zeppelin",
|
"name": "@zeppelin/zeppelin",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"dependencies": {
|
|
||||||
"knub": "^30.0.0-beta.39"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"husky": "^3.0.9",
|
"husky": "^3.0.9",
|
||||||
"lint-staged": "^9.4.2",
|
"lint-staged": "^9.4.2",
|
||||||
|
@ -40,48 +37,6 @@
|
||||||
"js-tokens": "^4.0.0"
|
"js-tokens": "^4.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@discordjs/builders": {
|
|
||||||
"version": "0.5.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.5.0.tgz",
|
|
||||||
"integrity": "sha512-HP5y4Rqw68o61Qv4qM5tVmDbWi4mdTFftqIOGRo33SNPpLJ1Ga3KEIR2ibKofkmsoQhEpLmopD1AZDs3cKpHuw==",
|
|
||||||
"dependencies": {
|
|
||||||
"@sindresorhus/is": "^4.0.1",
|
|
||||||
"discord-api-types": "^0.22.0",
|
|
||||||
"ow": "^0.27.0",
|
|
||||||
"ts-mixer": "^6.0.0",
|
|
||||||
"tslib": "^2.3.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=14.0.0",
|
|
||||||
"npm": ">=7.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@discordjs/builders/node_modules/tslib": {
|
|
||||||
"version": "2.3.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
|
||||||
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
|
|
||||||
},
|
|
||||||
"node_modules/@discordjs/collection": {
|
|
||||||
"version": "0.2.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.2.1.tgz",
|
|
||||||
"integrity": "sha512-vhxqzzM8gkomw0TYRF3tgx7SwElzUlXT/Aa41O7mOcyN6wIJfj5JmDWaO5XGKsGSsNx7F3i5oIlrucCCWV1Nog==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=14.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@discordjs/form-data": {
|
|
||||||
"version": "3.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@discordjs/form-data/-/form-data-3.0.1.tgz",
|
|
||||||
"integrity": "sha512-ZfFsbgEXW71Rw/6EtBdrP5VxBJy4dthyC0tpQKGKmYFImlmmrykO14Za+BiIVduwjte0jXEBlhSKf0MWbFp9Eg==",
|
|
||||||
"dependencies": {
|
|
||||||
"asynckit": "^0.4.0",
|
|
||||||
"combined-stream": "^1.0.8",
|
|
||||||
"mime-types": "^2.1.12"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 6"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@nodelib/fs.scandir": {
|
"node_modules/@nodelib/fs.scandir": {
|
||||||
"version": "2.1.3",
|
"version": "2.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz",
|
||||||
|
@ -129,26 +84,6 @@
|
||||||
"node": ">=6"
|
"node": ">=6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@sapphire/async-queue": {
|
|
||||||
"version": "1.1.4",
|
|
||||||
"resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.1.4.tgz",
|
|
||||||
"integrity": "sha512-fFrlF/uWpGOX5djw5Mu2Hnnrunao75WGey0sP0J3jnhmrJ5TAPzHYOmytD5iN/+pMxS+f+u/gezqHa9tPhRHEA==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=14",
|
|
||||||
"npm": ">=6"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@sindresorhus/is": {
|
|
||||||
"version": "4.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.0.1.tgz",
|
|
||||||
"integrity": "sha512-Qm9hBEBu18wt1PO2flE7LPb30BHMQt1eQgbV76YntdNk73XZGpn3izvGTYxbGgzXKgbCjiia0uxTd3aTNQrY/g==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=10"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/sindresorhus/is?sponsor=1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@types/events": {
|
"node_modules/@types/events": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz",
|
||||||
|
@ -175,7 +110,8 @@
|
||||||
"node_modules/@types/node": {
|
"node_modules/@types/node": {
|
||||||
"version": "12.12.5",
|
"version": "12.12.5",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.5.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.5.tgz",
|
||||||
"integrity": "sha512-KEjODidV4XYUlJBF3XdjSH5FWoMCtO0utnhtdLf1AgeuZLOrRbvmU/gaRCVg7ZaQDjVf3l84egiY0mRNe5xE4A=="
|
"integrity": "sha512-KEjODidV4XYUlJBF3XdjSH5FWoMCtO0utnhtdLf1AgeuZLOrRbvmU/gaRCVg7ZaQDjVf3l84egiY0mRNe5xE4A==",
|
||||||
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@types/normalize-package-data": {
|
"node_modules/@types/normalize-package-data": {
|
||||||
"version": "2.4.0",
|
"version": "2.4.0",
|
||||||
|
@ -183,14 +119,6 @@
|
||||||
"integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==",
|
"integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@types/ws": {
|
|
||||||
"version": "7.4.7",
|
|
||||||
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz",
|
|
||||||
"integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==",
|
|
||||||
"dependencies": {
|
|
||||||
"@types/node": "*"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/aggregate-error": {
|
"node_modules/aggregate-error": {
|
||||||
"version": "3.0.1",
|
"version": "3.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz",
|
||||||
|
@ -261,11 +189,6 @@
|
||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/asynckit": {
|
|
||||||
"version": "0.4.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
|
||||||
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
|
||||||
},
|
|
||||||
"node_modules/balanced-match": {
|
"node_modules/balanced-match": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
||||||
|
@ -414,17 +337,6 @@
|
||||||
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
|
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/combined-stream": {
|
|
||||||
"version": "1.0.8",
|
|
||||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
|
||||||
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
|
||||||
"dependencies": {
|
|
||||||
"delayed-stream": "~1.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 0.8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/commander": {
|
"node_modules/commander": {
|
||||||
"version": "2.20.3",
|
"version": "2.20.3",
|
||||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
|
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
|
||||||
|
@ -509,14 +421,6 @@
|
||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/delayed-stream": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
|
||||||
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.4.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/diff": {
|
"node_modules/diff": {
|
||||||
"version": "4.0.1",
|
"version": "4.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz",
|
||||||
|
@ -538,55 +442,6 @@
|
||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/discord-api-types": {
|
|
||||||
"version": "0.22.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz",
|
|
||||||
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/discord.js": {
|
|
||||||
"version": "13.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.1.0.tgz",
|
|
||||||
"integrity": "sha512-gxO4CXKdHpqA+WKG+f5RNnd3srTDj5uFJHgOathksDE90YNq/Qijkd2WlMgTTMS6AJoEnHxI7G9eDQHCuZ+xDA==",
|
|
||||||
"dependencies": {
|
|
||||||
"@discordjs/builders": "^0.5.0",
|
|
||||||
"@discordjs/collection": "^0.2.1",
|
|
||||||
"@discordjs/form-data": "^3.0.1",
|
|
||||||
"@sapphire/async-queue": "^1.1.4",
|
|
||||||
"@types/ws": "^7.4.7",
|
|
||||||
"discord-api-types": "^0.22.0",
|
|
||||||
"node-fetch": "^2.6.1",
|
|
||||||
"ws": "^7.5.1"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=16.6.0",
|
|
||||||
"npm": ">=7.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/dot-prop": {
|
|
||||||
"version": "6.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz",
|
|
||||||
"integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==",
|
|
||||||
"dependencies": {
|
|
||||||
"is-obj": "^2.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=10"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/dot-prop/node_modules/is-obj": {
|
|
||||||
"version": "2.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz",
|
|
||||||
"integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/elegant-spinner": {
|
"node_modules/elegant-spinner": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/elegant-spinner/-/elegant-spinner-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/elegant-spinner/-/elegant-spinner-1.0.1.tgz",
|
||||||
|
@ -1065,33 +920,6 @@
|
||||||
"integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==",
|
"integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/knub": {
|
|
||||||
"version": "30.0.0-beta.39",
|
|
||||||
"resolved": "https://registry.npmjs.org/knub/-/knub-30.0.0-beta.39.tgz",
|
|
||||||
"integrity": "sha512-L9RYkqh7YcWfw0ZXdGrKEZru/J+mkiyn+8vi1xCvjEdKMPdq4Gov/SG4suajMFhhX3RXdvh8BoE/3gbR2cq4xA==",
|
|
||||||
"dependencies": {
|
|
||||||
"discord-api-types": "^0.22.0",
|
|
||||||
"discord.js": "^13.0.1",
|
|
||||||
"knub-command-manager": "^9.1.0",
|
|
||||||
"ts-essentials": "^6.0.7"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/knub-command-manager": {
|
|
||||||
"version": "9.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/knub-command-manager/-/knub-command-manager-9.1.0.tgz",
|
|
||||||
"integrity": "sha512-pEtpWElbBoTRSL8kWSPRrTIuTIdvYGkP/wzOn77cieumC02adfwEt1Cc09HFvVT4ib35nf1y31oul36csaG7Vg==",
|
|
||||||
"dependencies": {
|
|
||||||
"escape-string-regexp": "^2.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/knub-command-manager/node_modules/escape-string-regexp": {
|
|
||||||
"version": "2.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz",
|
|
||||||
"integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/lines-and-columns": {
|
"node_modules/lines-and-columns": {
|
||||||
"version": "1.1.6",
|
"version": "1.1.6",
|
||||||
"resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz",
|
"resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz",
|
||||||
|
@ -1398,11 +1226,6 @@
|
||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/lodash.isequal": {
|
|
||||||
"version": "4.5.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz",
|
|
||||||
"integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA="
|
|
||||||
},
|
|
||||||
"node_modules/log-symbols": {
|
"node_modules/log-symbols": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz",
|
||||||
|
@ -1457,25 +1280,6 @@
|
||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/mime-db": {
|
|
||||||
"version": "1.49.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.49.0.tgz",
|
|
||||||
"integrity": "sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 0.6"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/mime-types": {
|
|
||||||
"version": "2.1.32",
|
|
||||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.32.tgz",
|
|
||||||
"integrity": "sha512-hJGaVS4G4c9TSMYh2n6SQAGrC4RnfU+daP8G7cSCmaqNjiOoUY0VHCMS42pxnQmVF1GWwFhbHWn3RIxCqTmZ9A==",
|
|
||||||
"dependencies": {
|
|
||||||
"mime-db": "1.49.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 0.6"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/mimic-fn": {
|
"node_modules/mimic-fn": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
|
||||||
|
@ -1528,14 +1332,6 @@
|
||||||
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
|
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/node-fetch": {
|
|
||||||
"version": "2.6.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
|
|
||||||
"integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==",
|
|
||||||
"engines": {
|
|
||||||
"node": "4.x || >=6.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/normalize-package-data": {
|
"node_modules/normalize-package-data": {
|
||||||
"version": "2.5.0",
|
"version": "2.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz",
|
||||||
|
@ -1617,44 +1413,6 @@
|
||||||
"opencollective-postinstall": "index.js"
|
"opencollective-postinstall": "index.js"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/ow": {
|
|
||||||
"version": "0.27.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/ow/-/ow-0.27.0.tgz",
|
|
||||||
"integrity": "sha512-SGnrGUbhn4VaUGdU0EJLMwZWSupPmF46hnTRII7aCLCrqixTAC5eKo8kI4/XXf1eaaI8YEVT+3FeGNJI9himAQ==",
|
|
||||||
"dependencies": {
|
|
||||||
"@sindresorhus/is": "^4.0.1",
|
|
||||||
"callsites": "^3.1.0",
|
|
||||||
"dot-prop": "^6.0.1",
|
|
||||||
"lodash.isequal": "^4.5.0",
|
|
||||||
"type-fest": "^1.2.1",
|
|
||||||
"vali-date": "^1.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/ow/node_modules/callsites": {
|
|
||||||
"version": "3.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
|
|
||||||
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=6"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/ow/node_modules/type-fest": {
|
|
||||||
"version": "1.4.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz",
|
|
||||||
"integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=10"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/p-finally": {
|
"node_modules/p-finally": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
|
||||||
|
@ -2171,19 +1929,6 @@
|
||||||
"node": ">=8.0"
|
"node": ">=8.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/ts-essentials": {
|
|
||||||
"version": "6.0.7",
|
|
||||||
"resolved": "https://registry.npmjs.org/ts-essentials/-/ts-essentials-6.0.7.tgz",
|
|
||||||
"integrity": "sha512-2E4HIIj4tQJlIHuATRHayv0EfMGK3ris/GRk1E3CFnsZzeNV+hUmelbaTZHLtXaZppM5oLhHRtO04gINC4Jusw==",
|
|
||||||
"peerDependencies": {
|
|
||||||
"typescript": ">=3.7.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/ts-mixer": {
|
|
||||||
"version": "6.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.0.tgz",
|
|
||||||
"integrity": "sha512-nXIb1fvdY5CBSrDIblLn73NW0qRDk5yJ0Sk1qPBF560OdJfQp9jhl+0tzcY09OZ9U+6GpeoI9RjwoIKFIoB9MQ=="
|
|
||||||
},
|
|
||||||
"node_modules/tslib": {
|
"node_modules/tslib": {
|
||||||
"version": "1.10.0",
|
"version": "1.10.0",
|
||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz",
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz",
|
||||||
|
@ -2257,6 +2002,7 @@
|
||||||
"version": "4.9.5",
|
"version": "4.9.5",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
|
||||||
"integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
|
"integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
|
||||||
|
"dev": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"tsc": "bin/tsc",
|
"tsc": "bin/tsc",
|
||||||
"tsserver": "bin/tsserver"
|
"tsserver": "bin/tsserver"
|
||||||
|
@ -2265,14 +2011,6 @@
|
||||||
"node": ">=4.2.0"
|
"node": ">=4.2.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/vali-date": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz",
|
|
||||||
"integrity": "sha1-G5BKWWCfsyjvB4E4Qgk09rhnCaY=",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.10.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/validate-npm-package-license": {
|
"node_modules/validate-npm-package-license": {
|
||||||
"version": "3.0.4",
|
"version": "3.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
|
||||||
|
@ -2356,26 +2094,6 @@
|
||||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
|
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
|
||||||
"node_modules/ws": {
|
|
||||||
"version": "7.5.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.3.tgz",
|
|
||||||
"integrity": "sha512-kQ/dHIzuLrS6Je9+uv81ueZomEwH0qVYstcAQ4/Z93K8zeko9gtAbttJWzoC5ukqXY1PpoouV3+VSOqEAFt5wg==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8.3.0"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"bufferutil": "^4.0.1",
|
|
||||||
"utf-8-validate": "^5.0.2"
|
|
||||||
},
|
|
||||||
"peerDependenciesMeta": {
|
|
||||||
"bufferutil": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"utf-8-validate": {
|
|
||||||
"optional": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -2399,40 +2117,6 @@
|
||||||
"js-tokens": "^4.0.0"
|
"js-tokens": "^4.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@discordjs/builders": {
|
|
||||||
"version": "0.5.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.5.0.tgz",
|
|
||||||
"integrity": "sha512-HP5y4Rqw68o61Qv4qM5tVmDbWi4mdTFftqIOGRo33SNPpLJ1Ga3KEIR2ibKofkmsoQhEpLmopD1AZDs3cKpHuw==",
|
|
||||||
"requires": {
|
|
||||||
"@sindresorhus/is": "^4.0.1",
|
|
||||||
"discord-api-types": "^0.22.0",
|
|
||||||
"ow": "^0.27.0",
|
|
||||||
"ts-mixer": "^6.0.0",
|
|
||||||
"tslib": "^2.3.0"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"tslib": {
|
|
||||||
"version": "2.3.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
|
||||||
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"@discordjs/collection": {
|
|
||||||
"version": "0.2.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.2.1.tgz",
|
|
||||||
"integrity": "sha512-vhxqzzM8gkomw0TYRF3tgx7SwElzUlXT/Aa41O7mOcyN6wIJfj5JmDWaO5XGKsGSsNx7F3i5oIlrucCCWV1Nog=="
|
|
||||||
},
|
|
||||||
"@discordjs/form-data": {
|
|
||||||
"version": "3.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@discordjs/form-data/-/form-data-3.0.1.tgz",
|
|
||||||
"integrity": "sha512-ZfFsbgEXW71Rw/6EtBdrP5VxBJy4dthyC0tpQKGKmYFImlmmrykO14Za+BiIVduwjte0jXEBlhSKf0MWbFp9Eg==",
|
|
||||||
"requires": {
|
|
||||||
"asynckit": "^0.4.0",
|
|
||||||
"combined-stream": "^1.0.8",
|
|
||||||
"mime-types": "^2.1.12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"@nodelib/fs.scandir": {
|
"@nodelib/fs.scandir": {
|
||||||
"version": "2.1.3",
|
"version": "2.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz",
|
||||||
|
@ -2468,16 +2152,6 @@
|
||||||
"any-observable": "^0.3.0"
|
"any-observable": "^0.3.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@sapphire/async-queue": {
|
|
||||||
"version": "1.1.4",
|
|
||||||
"resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.1.4.tgz",
|
|
||||||
"integrity": "sha512-fFrlF/uWpGOX5djw5Mu2Hnnrunao75WGey0sP0J3jnhmrJ5TAPzHYOmytD5iN/+pMxS+f+u/gezqHa9tPhRHEA=="
|
|
||||||
},
|
|
||||||
"@sindresorhus/is": {
|
|
||||||
"version": "4.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.0.1.tgz",
|
|
||||||
"integrity": "sha512-Qm9hBEBu18wt1PO2flE7LPb30BHMQt1eQgbV76YntdNk73XZGpn3izvGTYxbGgzXKgbCjiia0uxTd3aTNQrY/g=="
|
|
||||||
},
|
|
||||||
"@types/events": {
|
"@types/events": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz",
|
||||||
|
@ -2504,7 +2178,8 @@
|
||||||
"@types/node": {
|
"@types/node": {
|
||||||
"version": "12.12.5",
|
"version": "12.12.5",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.5.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.5.tgz",
|
||||||
"integrity": "sha512-KEjODidV4XYUlJBF3XdjSH5FWoMCtO0utnhtdLf1AgeuZLOrRbvmU/gaRCVg7ZaQDjVf3l84egiY0mRNe5xE4A=="
|
"integrity": "sha512-KEjODidV4XYUlJBF3XdjSH5FWoMCtO0utnhtdLf1AgeuZLOrRbvmU/gaRCVg7ZaQDjVf3l84egiY0mRNe5xE4A==",
|
||||||
|
"dev": true
|
||||||
},
|
},
|
||||||
"@types/normalize-package-data": {
|
"@types/normalize-package-data": {
|
||||||
"version": "2.4.0",
|
"version": "2.4.0",
|
||||||
|
@ -2512,14 +2187,6 @@
|
||||||
"integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==",
|
"integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@types/ws": {
|
|
||||||
"version": "7.4.7",
|
|
||||||
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz",
|
|
||||||
"integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==",
|
|
||||||
"requires": {
|
|
||||||
"@types/node": "*"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"aggregate-error": {
|
"aggregate-error": {
|
||||||
"version": "3.0.1",
|
"version": "3.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz",
|
||||||
|
@ -2572,11 +2239,6 @@
|
||||||
"integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==",
|
"integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"asynckit": {
|
|
||||||
"version": "0.4.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
|
||||||
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
|
||||||
},
|
|
||||||
"balanced-match": {
|
"balanced-match": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
||||||
|
@ -2695,14 +2357,6 @@
|
||||||
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
|
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"combined-stream": {
|
|
||||||
"version": "1.0.8",
|
|
||||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
|
||||||
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
|
||||||
"requires": {
|
|
||||||
"delayed-stream": "~1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"commander": {
|
"commander": {
|
||||||
"version": "2.20.3",
|
"version": "2.20.3",
|
||||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
|
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
|
||||||
|
@ -2777,11 +2431,6 @@
|
||||||
"slash": "^3.0.0"
|
"slash": "^3.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"delayed-stream": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
|
||||||
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
|
|
||||||
},
|
|
||||||
"diff": {
|
"diff": {
|
||||||
"version": "4.0.1",
|
"version": "4.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz",
|
||||||
|
@ -2797,41 +2446,6 @@
|
||||||
"path-type": "^4.0.0"
|
"path-type": "^4.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"discord-api-types": {
|
|
||||||
"version": "0.22.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz",
|
|
||||||
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg=="
|
|
||||||
},
|
|
||||||
"discord.js": {
|
|
||||||
"version": "13.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.1.0.tgz",
|
|
||||||
"integrity": "sha512-gxO4CXKdHpqA+WKG+f5RNnd3srTDj5uFJHgOathksDE90YNq/Qijkd2WlMgTTMS6AJoEnHxI7G9eDQHCuZ+xDA==",
|
|
||||||
"requires": {
|
|
||||||
"@discordjs/builders": "^0.5.0",
|
|
||||||
"@discordjs/collection": "^0.2.1",
|
|
||||||
"@discordjs/form-data": "^3.0.1",
|
|
||||||
"@sapphire/async-queue": "^1.1.4",
|
|
||||||
"@types/ws": "^7.4.7",
|
|
||||||
"discord-api-types": "^0.22.0",
|
|
||||||
"node-fetch": "^2.6.1",
|
|
||||||
"ws": "^7.5.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"dot-prop": {
|
|
||||||
"version": "6.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz",
|
|
||||||
"integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==",
|
|
||||||
"requires": {
|
|
||||||
"is-obj": "^2.0.0"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"is-obj": {
|
|
||||||
"version": "2.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz",
|
|
||||||
"integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w=="
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"elegant-spinner": {
|
"elegant-spinner": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/elegant-spinner/-/elegant-spinner-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/elegant-spinner/-/elegant-spinner-1.0.1.tgz",
|
||||||
|
@ -3205,32 +2819,6 @@
|
||||||
"integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==",
|
"integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"knub": {
|
|
||||||
"version": "30.0.0-beta.39",
|
|
||||||
"resolved": "https://registry.npmjs.org/knub/-/knub-30.0.0-beta.39.tgz",
|
|
||||||
"integrity": "sha512-L9RYkqh7YcWfw0ZXdGrKEZru/J+mkiyn+8vi1xCvjEdKMPdq4Gov/SG4suajMFhhX3RXdvh8BoE/3gbR2cq4xA==",
|
|
||||||
"requires": {
|
|
||||||
"discord-api-types": "^0.22.0",
|
|
||||||
"discord.js": "^13.0.1",
|
|
||||||
"knub-command-manager": "^9.1.0",
|
|
||||||
"ts-essentials": "^6.0.7"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"knub-command-manager": {
|
|
||||||
"version": "9.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/knub-command-manager/-/knub-command-manager-9.1.0.tgz",
|
|
||||||
"integrity": "sha512-pEtpWElbBoTRSL8kWSPRrTIuTIdvYGkP/wzOn77cieumC02adfwEt1Cc09HFvVT4ib35nf1y31oul36csaG7Vg==",
|
|
||||||
"requires": {
|
|
||||||
"escape-string-regexp": "^2.0.0"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"escape-string-regexp": {
|
|
||||||
"version": "2.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz",
|
|
||||||
"integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w=="
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"lines-and-columns": {
|
"lines-and-columns": {
|
||||||
"version": "1.1.6",
|
"version": "1.1.6",
|
||||||
"resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz",
|
"resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz",
|
||||||
|
@ -3470,11 +3058,6 @@
|
||||||
"p-locate": "^4.1.0"
|
"p-locate": "^4.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lodash.isequal": {
|
|
||||||
"version": "4.5.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz",
|
|
||||||
"integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA="
|
|
||||||
},
|
|
||||||
"log-symbols": {
|
"log-symbols": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz",
|
||||||
|
@ -3517,19 +3100,6 @@
|
||||||
"picomatch": "^2.0.5"
|
"picomatch": "^2.0.5"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mime-db": {
|
|
||||||
"version": "1.49.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.49.0.tgz",
|
|
||||||
"integrity": "sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA=="
|
|
||||||
},
|
|
||||||
"mime-types": {
|
|
||||||
"version": "2.1.32",
|
|
||||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.32.tgz",
|
|
||||||
"integrity": "sha512-hJGaVS4G4c9TSMYh2n6SQAGrC4RnfU+daP8G7cSCmaqNjiOoUY0VHCMS42pxnQmVF1GWwFhbHWn3RIxCqTmZ9A==",
|
|
||||||
"requires": {
|
|
||||||
"mime-db": "1.49.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"mimic-fn": {
|
"mimic-fn": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
|
||||||
|
@ -3574,11 +3144,6 @@
|
||||||
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
|
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node-fetch": {
|
|
||||||
"version": "2.6.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
|
|
||||||
"integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw=="
|
|
||||||
},
|
|
||||||
"normalize-package-data": {
|
"normalize-package-data": {
|
||||||
"version": "2.5.0",
|
"version": "2.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz",
|
||||||
|
@ -3642,31 +3207,6 @@
|
||||||
"integrity": "sha512-pVOEP16TrAO2/fjej1IdOyupJY8KDUM1CvsaScRbw6oddvpQoOfGk4ywha0HKKVAD6RkW4x6Q+tNBwhf3Bgpuw==",
|
"integrity": "sha512-pVOEP16TrAO2/fjej1IdOyupJY8KDUM1CvsaScRbw6oddvpQoOfGk4ywha0HKKVAD6RkW4x6Q+tNBwhf3Bgpuw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"ow": {
|
|
||||||
"version": "0.27.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/ow/-/ow-0.27.0.tgz",
|
|
||||||
"integrity": "sha512-SGnrGUbhn4VaUGdU0EJLMwZWSupPmF46hnTRII7aCLCrqixTAC5eKo8kI4/XXf1eaaI8YEVT+3FeGNJI9himAQ==",
|
|
||||||
"requires": {
|
|
||||||
"@sindresorhus/is": "^4.0.1",
|
|
||||||
"callsites": "^3.1.0",
|
|
||||||
"dot-prop": "^6.0.1",
|
|
||||||
"lodash.isequal": "^4.5.0",
|
|
||||||
"type-fest": "^1.2.1",
|
|
||||||
"vali-date": "^1.0.0"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"callsites": {
|
|
||||||
"version": "3.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
|
|
||||||
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ=="
|
|
||||||
},
|
|
||||||
"type-fest": {
|
|
||||||
"version": "1.4.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz",
|
|
||||||
"integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA=="
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"p-finally": {
|
"p-finally": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
|
||||||
|
@ -4053,17 +3593,6 @@
|
||||||
"is-number": "^7.0.0"
|
"is-number": "^7.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ts-essentials": {
|
|
||||||
"version": "6.0.7",
|
|
||||||
"resolved": "https://registry.npmjs.org/ts-essentials/-/ts-essentials-6.0.7.tgz",
|
|
||||||
"integrity": "sha512-2E4HIIj4tQJlIHuATRHayv0EfMGK3ris/GRk1E3CFnsZzeNV+hUmelbaTZHLtXaZppM5oLhHRtO04gINC4Jusw==",
|
|
||||||
"requires": {}
|
|
||||||
},
|
|
||||||
"ts-mixer": {
|
|
||||||
"version": "6.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.0.tgz",
|
|
||||||
"integrity": "sha512-nXIb1fvdY5CBSrDIblLn73NW0qRDk5yJ0Sk1qPBF560OdJfQp9jhl+0tzcY09OZ9U+6GpeoI9RjwoIKFIoB9MQ=="
|
|
||||||
},
|
|
||||||
"tslib": {
|
"tslib": {
|
||||||
"version": "1.10.0",
|
"version": "1.10.0",
|
||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz",
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz",
|
||||||
|
@ -4115,12 +3644,8 @@
|
||||||
"typescript": {
|
"typescript": {
|
||||||
"version": "4.9.5",
|
"version": "4.9.5",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
|
||||||
"integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g=="
|
"integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
|
||||||
},
|
"dev": true
|
||||||
"vali-date": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz",
|
|
||||||
"integrity": "sha1-G5BKWWCfsyjvB4E4Qgk09rhnCaY="
|
|
||||||
},
|
},
|
||||||
"validate-npm-package-license": {
|
"validate-npm-package-license": {
|
||||||
"version": "3.0.4",
|
"version": "3.0.4",
|
||||||
|
@ -4189,12 +3714,6 @@
|
||||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
|
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
|
||||||
"ws": {
|
|
||||||
"version": "7.5.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.3.tgz",
|
|
||||||
"integrity": "sha512-kQ/dHIzuLrS6Je9+uv81ueZomEwH0qVYstcAQ4/Z93K8zeko9gtAbttJWzoC5ukqXY1PpoouV3+VSOqEAFt5wg==",
|
|
||||||
"requires": {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,8 +28,5 @@
|
||||||
"prettier --write",
|
"prettier --write",
|
||||||
"git add"
|
"git add"
|
||||||
]
|
]
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"knub": "^30.0.0-beta.39"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "NodeNext",
|
||||||
"module": "commonjs",
|
"module": "NodeNext",
|
||||||
"noImplicitAny": false,
|
"noImplicitAny": false,
|
||||||
"allowSyntheticDefaultImports": true,
|
"allowSyntheticDefaultImports": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"target": "es2018",
|
"target": "es2022",
|
||||||
"lib": ["esnext"],
|
"lib": ["es2022"],
|
||||||
"baseUrl": "src",
|
"baseUrl": "src",
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue