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",
|
||||
"io-ts": "^2.0.0",
|
||||
"js-yaml": "^3.13.1",
|
||||
"knub": "^31.0.0",
|
||||
"knub": "^32.0.0-next.4",
|
||||
"knub-command-manager": "^9.1.0",
|
||||
"last-commit-log": "^2.1.0",
|
||||
"lodash.chunk": "^4.2.0",
|
||||
|
@ -2704,15 +2704,17 @@
|
|||
}
|
||||
},
|
||||
"node_modules/knub": {
|
||||
"version": "31.0.0",
|
||||
"resolved": "https://registry.npmjs.org/knub/-/knub-31.0.0.tgz",
|
||||
"integrity": "sha512-mm2PrtQ9G5UoELfJ4kjWaNQZZRMhwJbCf4FgJj92iDy4pg95XPNWAkwTw8avbkslNjb9m5Va1pp3IeJayvz/ag==",
|
||||
"version": "32.0.0-next.4",
|
||||
"resolved": "https://registry.npmjs.org/knub/-/knub-32.0.0-next.4.tgz",
|
||||
"integrity": "sha512-ywZbwcGFSr4Erl/nEUDVmziQHXKVIykWtI2Z05DLt01YmxDS+rTO8l/E6LYx7ZL3m+f2DbtLH0HB8zaZb0pUag==",
|
||||
"dependencies": {
|
||||
"discord-api-types": "^0.37.10",
|
||||
"discord.js": "^14",
|
||||
"discord.js": "^14.8.0",
|
||||
"knub-command-manager": "^9.1.0",
|
||||
"ts-essentials": "^9",
|
||||
"zod": "^3.19.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16"
|
||||
}
|
||||
},
|
||||
"node_modules/knub-command-manager": {
|
||||
|
@ -7199,12 +7201,11 @@
|
|||
}
|
||||
},
|
||||
"knub": {
|
||||
"version": "31.0.0",
|
||||
"resolved": "https://registry.npmjs.org/knub/-/knub-31.0.0.tgz",
|
||||
"integrity": "sha512-mm2PrtQ9G5UoELfJ4kjWaNQZZRMhwJbCf4FgJj92iDy4pg95XPNWAkwTw8avbkslNjb9m5Va1pp3IeJayvz/ag==",
|
||||
"version": "32.0.0-next.4",
|
||||
"resolved": "https://registry.npmjs.org/knub/-/knub-32.0.0-next.4.tgz",
|
||||
"integrity": "sha512-ywZbwcGFSr4Erl/nEUDVmziQHXKVIykWtI2Z05DLt01YmxDS+rTO8l/E6LYx7ZL3m+f2DbtLH0HB8zaZb0pUag==",
|
||||
"requires": {
|
||||
"discord-api-types": "^0.37.10",
|
||||
"discord.js": "^14",
|
||||
"discord.js": "^14.8.0",
|
||||
"knub-command-manager": "^9.1.0",
|
||||
"ts-essentials": "^9",
|
||||
"zod": "^3.19.1"
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
"humanize-duration": "^3.15.0",
|
||||
"io-ts": "^2.0.0",
|
||||
"js-yaml": "^3.13.1",
|
||||
"knub": "^31.0.0",
|
||||
"knub": "^32.0.0-next.4",
|
||||
"knub-command-manager": "^9.1.0",
|
||||
"last-commit-log": "^2.1.0",
|
||||
"lodash.chunk": "^4.2.0",
|
||||
|
|
|
@ -66,7 +66,7 @@ export function initDocs(app: express.Express) {
|
|||
}));
|
||||
|
||||
const defaultOptions = plugin.defaultOptions || {};
|
||||
const configSchema = plugin.configSchema && formatConfigSchema(plugin.configSchema);
|
||||
const configSchema = plugin.info?.configSchema && formatConfigSchema(plugin.info.configSchema);
|
||||
|
||||
res.json({
|
||||
name,
|
||||
|
|
|
@ -20,5 +20,5 @@ setIsAPI(true);
|
|||
// 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
|
||||
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)!;
|
||||
try {
|
||||
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) {
|
||||
if (err instanceof ConfigValidationError || err instanceof StrictValidationError) {
|
||||
return `${pluginName}: ${err.message}`;
|
||||
|
|
|
@ -2,21 +2,14 @@ import {
|
|||
Client,
|
||||
Events,
|
||||
GatewayIntentBits,
|
||||
GuildTextBasedChannel,
|
||||
Message,
|
||||
Options,
|
||||
Partials,
|
||||
RESTEvents,
|
||||
TextBasedChannel,
|
||||
TextChannel,
|
||||
ThreadChannel,
|
||||
} 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 { PluginNotLoadedError } from "knub/dist/plugins/PluginNotLoadedError";
|
||||
import { Knub, PluginError, PluginLoadError, PluginNotLoadedError } from "knub";
|
||||
import moment from "moment-timezone";
|
||||
import { performance } from "perf_hooks";
|
||||
import { AllowedGuilds } from "./data/AllowedGuilds";
|
||||
|
@ -48,18 +41,6 @@ import { DecayingCounter } from "./utils/DecayingCounter";
|
|||
import { enableProfiling } from "./utils/easyProfiler";
|
||||
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
|
||||
let recentPluginErrors = 0;
|
||||
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}`);
|
||||
}
|
||||
|
||||
// Always use UTC internally
|
||||
// This is also enforced for the database in data/db.ts
|
||||
moment.tz.setDefault("UTC");
|
||||
|
||||
// Blocking check
|
||||
|
|
|
@ -4,17 +4,21 @@
|
|||
|
||||
import { GuildMember, Message, MessageCreateOptions, MessageMentionOptions, TextBasedChannel } from "discord.js";
|
||||
import * as t from "io-ts";
|
||||
import { CommandContext, configUtils, ConfigValidationError, GuildPluginData, helpers, PluginOptions } from "knub";
|
||||
import { PluginOverrideCriteria } from "knub/dist/config/configTypes";
|
||||
import { ExtendedMatchParams } from "knub/dist/config/PluginConfigManager"; // TODO: Export from Knub index
|
||||
import { AnyPluginData } from "knub/dist/plugins/PluginData";
|
||||
import {
|
||||
AnyPluginData,
|
||||
CommandContext,
|
||||
ConfigValidationError,
|
||||
ExtendedMatchParams,
|
||||
GuildPluginData,
|
||||
helpers,
|
||||
PluginOverrideCriteria,
|
||||
} from "knub";
|
||||
import { logger } from "./logger";
|
||||
import { ZeppelinPlugin } from "./plugins/ZeppelinPlugin";
|
||||
import { isStaff } from "./staff";
|
||||
import { TZeppelinKnub } from "./types";
|
||||
import { deepKeyIntersect, errorMessage, successMessage, tDeepPartial, tNullable } from "./utils";
|
||||
import { errorMessage, successMessage, tNullable } from "./utils";
|
||||
import { Tail } from "./utils/typeUtils";
|
||||
import { decodeAndValidateStrict, StrictValidationError, validate } from "./validatorUtils";
|
||||
import { StrictValidationError, validate } from "./validatorUtils";
|
||||
|
||||
const { getMemberLevel } = helpers;
|
||||
|
||||
|
@ -91,102 +95,13 @@ export function strictValidationErrorToConfigValidationError(err: StrictValidati
|
|||
);
|
||||
}
|
||||
|
||||
export function getPluginConfigParser(blueprint: ZeppelinPlugin, customParser?: ZeppelinPlugin["configParser"]) {
|
||||
return async (options: PluginOptions<any>, strict?: boolean) => {
|
||||
const ident = `[getPluginConfigParser.${blueprint.name}] | `;
|
||||
if (blueprint.name === "mutes") {
|
||||
console.log(ident, "options => ", JSON.stringify(options));
|
||||
export function makeIoTsConfigParser<Schema extends t.Type<any>>(schema: Schema): (input: unknown) => t.TypeOf<Schema> {
|
||||
return (input: unknown) => {
|
||||
const error = validate(schema, input);
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
// 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,
|
||||
};
|
||||
return input as t.TypeOf<Schema>;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { PluginOptions } from "knub";
|
||||
import { GuildLogs } from "../../data/GuildLogs";
|
||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
|
@ -23,10 +24,11 @@ export const AutoDeletePlugin = zeppelinGuildPlugin<AutoDeletePluginType>()({
|
|||
prettyName: "Auto-delete",
|
||||
description: "Allows Zeppelin to auto-delete messages from a channel after a delay",
|
||||
configurationGuide: "Maximum deletion delay is currently 5 minutes",
|
||||
configSchema: ConfigSchema,
|
||||
},
|
||||
|
||||
dependencies: () => [TimeAndDatePlugin, LogsPlugin],
|
||||
configSchema: ConfigSchema,
|
||||
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||
defaultOptions,
|
||||
|
||||
beforeLoad(pluginData) {
|
||||
|
@ -62,7 +64,4 @@ export const AutoDeletePlugin = zeppelinGuildPlugin<AutoDeletePluginType>()({
|
|||
state.guildSavedMessages.events.off("delete", state.onMessageDeleteFn);
|
||||
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 { GuildAutoReactions } from "../../data/GuildAutoReactions";
|
||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||
import { trimPluginDescription } from "../../utils";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
|
@ -31,6 +32,7 @@ export const AutoReactionsPlugin = zeppelinGuildPlugin<AutoReactionsPluginType>(
|
|||
description: trimPluginDescription(`
|
||||
Allows setting up automatic reactions to all new messages on a channel
|
||||
`),
|
||||
configSchema: ConfigSchema,
|
||||
},
|
||||
|
||||
// prettier-ignore
|
||||
|
@ -38,7 +40,7 @@ export const AutoReactionsPlugin = zeppelinGuildPlugin<AutoReactionsPluginType>(
|
|||
LogsPlugin,
|
||||
],
|
||||
|
||||
configSchema: ConfigSchema,
|
||||
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
|
@ -59,7 +61,4 @@ export const AutoReactionsPlugin = zeppelinGuildPlugin<AutoReactionsPluginType>(
|
|||
state.autoReactions = GuildAutoReactions.getGuildInstance(guild.id);
|
||||
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 { GuildAntiraidLevels } from "../../data/GuildAntiraidLevels";
|
||||
import { GuildArchives } from "../../data/GuildArchives";
|
||||
|
@ -8,7 +9,7 @@ import { discardRegExpRunner, getRegExpRunner } from "../../regExpRunners";
|
|||
import { MINUTES, SECONDS } from "../../utils";
|
||||
import { registerEventListenersFromMap } from "../../utils/registerEventListenersFromMap";
|
||||
import { unregisterEventListenersFromMap } from "../../utils/unregisterEventListenersFromMap";
|
||||
import { StrictValidationError } from "../../validatorUtils";
|
||||
import { StrictValidationError, validate } from "../../validatorUtils";
|
||||
import { CountersPlugin } from "../Counters/CountersPlugin";
|
||||
import { InternalPosterPlugin } from "../InternalPoster/InternalPosterPlugin";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
|
@ -62,14 +63,15 @@ const defaultOptions = {
|
|||
|
||||
/**
|
||||
* Config preprocessor to set default values for triggers and perform extra validation
|
||||
* TODO: Separate input and output types
|
||||
*/
|
||||
|
||||
const configParser = (options) => {
|
||||
if (options.rules) {
|
||||
const configParser = (input: unknown) => {
|
||||
const rules = (input as any).rules;
|
||||
if (rules) {
|
||||
// Loop through each rule
|
||||
for (const [name, rule] of Object.entries(options.rules)) {
|
||||
for (const [name, rule] of Object.entries(rules)) {
|
||||
if (rule == null) {
|
||||
delete options.rules[name];
|
||||
delete rules[name];
|
||||
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>()({
|
||||
|
@ -188,7 +195,6 @@ export const AutomodPlugin = zeppelinGuildPlugin<AutomodPluginType>()({
|
|||
info: pluginInfo,
|
||||
|
||||
// prettier-ignore
|
||||
// @ts-expect-error
|
||||
dependencies: () => [
|
||||
LogsPlugin,
|
||||
ModActionsPlugin,
|
||||
|
@ -198,7 +204,6 @@ export const AutomodPlugin = zeppelinGuildPlugin<AutomodPluginType>()({
|
|||
InternalPosterPlugin,
|
||||
],
|
||||
|
||||
configSchema: ConfigSchema,
|
||||
defaultOptions,
|
||||
configParser,
|
||||
|
||||
|
@ -261,7 +266,6 @@ export const AutomodPlugin = zeppelinGuildPlugin<AutomodPluginType>()({
|
|||
|
||||
state.onMessageUpdateFn = (message) => runAutomodOnMessage(pluginData, message, true);
|
||||
state.savedMessages.events.on("update", state.onMessageUpdateFn);
|
||||
// @ts-expect-error
|
||||
const countersPlugin = pluginData.getPlugin(CountersPlugin);
|
||||
|
||||
state.onCounterTrigger = (name, triggerName, channelId, userId) => {
|
||||
|
@ -271,9 +275,7 @@ export const AutomodPlugin = zeppelinGuildPlugin<AutomodPluginType>()({
|
|||
state.onCounterReverseTrigger = (name, triggerName, channelId, userId) => {
|
||||
runAutomodOnCounterTrigger(pluginData, name, triggerName, channelId, userId, true);
|
||||
};
|
||||
// @ts-expect-error
|
||||
countersPlugin.onCounterEvent("trigger", state.onCounterTrigger);
|
||||
// @ts-expect-error
|
||||
countersPlugin.onCounterEvent("reverseTrigger", state.onCounterReverseTrigger);
|
||||
|
||||
const modActionsEvents = pluginData.getPlugin(ModActionsPlugin).getEventEmitter();
|
||||
|
@ -303,14 +305,11 @@ export const AutomodPlugin = zeppelinGuildPlugin<AutomodPluginType>()({
|
|||
async beforeUnload(pluginData) {
|
||||
const { state, guild } = pluginData;
|
||||
|
||||
// @ts-expect-error
|
||||
const countersPlugin = pluginData.getPlugin(CountersPlugin);
|
||||
if (state.onCounterTrigger) {
|
||||
// @ts-expect-error
|
||||
countersPlugin.offCounterEvent("trigger", state.onCounterTrigger);
|
||||
}
|
||||
if (state.onCounterReverseTrigger) {
|
||||
// @ts-expect-error
|
||||
countersPlugin.offCounterEvent("reverseTrigger", state.onCounterReverseTrigger);
|
||||
}
|
||||
|
||||
|
|
|
@ -12,9 +12,7 @@ export const AddToCounterAction = automodAction({
|
|||
defaultConfig: {},
|
||||
|
||||
async apply({ pluginData, contexts, actionConfig, matchResult, ruleName }) {
|
||||
// @ts-expect-error
|
||||
const countersPlugin = pluginData.getPlugin(CountersPlugin);
|
||||
// @ts-expect-error
|
||||
if (!countersPlugin.counterExists(actionConfig.counter)) {
|
||||
pluginData.getPlugin(LogsPlugin).logBotAlert({
|
||||
body: `Unknown counter \`${actionConfig.counter}\` in \`add_to_counter\` action of Automod rule \`${ruleName}\``,
|
||||
|
@ -22,7 +20,6 @@ export const AddToCounterAction = automodAction({
|
|||
return;
|
||||
}
|
||||
|
||||
// @ts-expect-error
|
||||
countersPlugin.changeCounterValue(
|
||||
actionConfig.counter,
|
||||
contexts[0].message?.channel_id || null,
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import { PermissionsBitField, PermissionsString } from "discord.js";
|
||||
import * as t from "io-ts";
|
||||
import { noop } from "knub/dist/utils";
|
||||
import { renderTemplate, TemplateSafeValueContainer } from "../../../templateFormatter";
|
||||
import { isValidSnowflake, tNullable, tPartialDictionary } from "../../../utils";
|
||||
import { isValidSnowflake, noop, tNullable, tPartialDictionary } from "../../../utils";
|
||||
import {
|
||||
guildToTemplateSafeGuild,
|
||||
savedMessageToTemplateSafeSavedMessage,
|
||||
|
|
|
@ -12,9 +12,7 @@ export const SetCounterAction = automodAction({
|
|||
defaultConfig: {},
|
||||
|
||||
async apply({ pluginData, contexts, actionConfig, matchResult, ruleName }) {
|
||||
// @ts-expect-error
|
||||
const countersPlugin = pluginData.getPlugin(CountersPlugin);
|
||||
// @ts-expect-error
|
||||
if (!countersPlugin.counterExists(actionConfig.counter)) {
|
||||
pluginData.getPlugin(LogsPlugin).logBotAlert({
|
||||
body: `Unknown counter \`${actionConfig.counter}\` in \`add_to_counter\` action of Automod rule \`${ruleName}\``,
|
||||
|
@ -22,7 +20,6 @@ export const SetCounterAction = automodAction({
|
|||
return;
|
||||
}
|
||||
|
||||
// @ts-expect-error
|
||||
countersPlugin.setCounterValue(
|
||||
actionConfig.counter,
|
||||
contexts[0].message?.channel_id || null,
|
||||
|
|
|
@ -14,11 +14,8 @@ export async function runAutomodOnCounterTrigger(
|
|||
) {
|
||||
const user = userId ? await resolveUser(pluginData.client, userId) : undefined;
|
||||
const member = (userId && (await resolveMember(pluginData.client, pluginData.guild, userId))) || undefined;
|
||||
// @ts-expect-error
|
||||
const prettyCounterName = pluginData.getPlugin(CountersPlugin).getPrettyNameForCounter(counterName);
|
||||
// @ts-expect-error
|
||||
const prettyTriggerName = pluginData
|
||||
// @ts-expect-error
|
||||
.getPlugin(CountersPlugin)
|
||||
.getPrettyNameForCounterTrigger(counterName, triggerName);
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import * as t from "io-ts";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { Awaitable } from "knub/dist/utils";
|
||||
import { Awaitable } from "../../utils/typeUtils";
|
||||
import { AutomodContext, AutomodPluginType } from "./types";
|
||||
|
||||
interface BaseAutomodTriggerMatchResult {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { trimPluginDescription } from "../../utils";
|
||||
import { ZeppelinGuildPluginBlueprint } from "../ZeppelinPluginBlueprint";
|
||||
import { ConfigSchema } from "./types";
|
||||
|
||||
export const pluginInfo: ZeppelinGuildPluginBlueprint["info"] = {
|
||||
prettyName: "Automod",
|
||||
|
@ -99,4 +100,5 @@ export const pluginInfo: ZeppelinGuildPluginBlueprint["info"] = {
|
|||
{matchSummary}
|
||||
~~~
|
||||
`),
|
||||
configSchema: ConfigSchema,
|
||||
};
|
||||
|
|
|
@ -3,7 +3,7 @@ import { AllowedGuilds } from "../../data/AllowedGuilds";
|
|||
import { ApiPermissionAssignments } from "../../data/ApiPermissionAssignments";
|
||||
import { Configs } from "../../data/Configs";
|
||||
import { GuildArchives } from "../../data/GuildArchives";
|
||||
import { sendSuccessMessage } from "../../pluginUtils";
|
||||
import { makeIoTsConfigParser, sendSuccessMessage } from "../../pluginUtils";
|
||||
import { zeppelinGlobalPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { getActiveReload, resetActiveReload } from "./activeReload";
|
||||
import { AddDashboardUserCmd } from "./commands/AddDashboardUserCmd";
|
||||
|
@ -37,7 +37,7 @@ const defaultOptions = {
|
|||
|
||||
export const BotControlPlugin = zeppelinGlobalPlugin<BotControlPluginType>()({
|
||||
name: "bot_control",
|
||||
configSchema: ConfigSchema,
|
||||
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||
defaultOptions,
|
||||
|
||||
// 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 { GuildCases } from "../../data/GuildCases";
|
||||
import { GuildLogs } from "../../data/GuildLogs";
|
||||
import { mapToPublicFn } from "../../pluginUtils";
|
||||
import { makeIoTsConfigParser, mapToPublicFn } from "../../pluginUtils";
|
||||
import { trimPluginDescription } from "../../utils";
|
||||
import { InternalPosterPlugin } from "../InternalPoster/InternalPosterPlugin";
|
||||
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
||||
|
@ -18,6 +18,11 @@ import { getTotalCasesByMod } from "./functions/getTotalCasesByMod";
|
|||
import { postCaseToCaseLogChannel } from "./functions/postToCaseLogChannel";
|
||||
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 = {
|
||||
config: {
|
||||
log_automatic_actions: true,
|
||||
|
@ -37,15 +42,11 @@ export const CasesPlugin = zeppelinGuildPlugin<CasesPluginType>()({
|
|||
description: trimPluginDescription(`
|
||||
This plugin contains basic configuration for cases created by other plugins
|
||||
`),
|
||||
configSchema: ConfigSchema,
|
||||
},
|
||||
|
||||
dependencies: async () => [
|
||||
TimeAndDatePlugin,
|
||||
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,
|
||||
dependencies: async () => [TimeAndDatePlugin, InternalPosterPlugin, (await getLogsPlugin()).LogsPlugin],
|
||||
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||
defaultOptions,
|
||||
|
||||
public: {
|
||||
|
@ -87,7 +88,4 @@ export const CasesPlugin = zeppelinGuildPlugin<CasesPluginType>()({
|
|||
state.archives = GuildArchives.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 { splitMessageIntoChunks } from "knub/dist/helpers";
|
||||
import { splitMessageIntoChunks } from "knub/helpers";
|
||||
import moment from "moment-timezone";
|
||||
import { Case } from "../../../data/entities/Case";
|
||||
import { convertDelayStringToMS, DAYS, DBDateFormat, disableLinkPreviews, messageLink } from "../../../utils";
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { PluginOptions } from "knub";
|
||||
import { GuildLogs } from "../../data/GuildLogs";
|
||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||
import { discardRegExpRunner, getRegExpRunner } from "../../regExpRunners";
|
||||
import { trimPluginDescription } from "../../utils";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
|
@ -53,10 +54,11 @@ export const CensorPlugin = zeppelinGuildPlugin<CensorPluginType>()({
|
|||
For more advanced filtering, check out the Automod plugin!
|
||||
`),
|
||||
legacy: true,
|
||||
configSchema: ConfigSchema,
|
||||
},
|
||||
|
||||
dependencies: () => [LogsPlugin],
|
||||
configSchema: ConfigSchema,
|
||||
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||
defaultOptions,
|
||||
|
||||
beforeLoad(pluginData) {
|
||||
|
@ -86,7 +88,4 @@ export const CensorPlugin = zeppelinGuildPlugin<CensorPluginType>()({
|
|||
state.savedMessages.events.off("create", state.onMessageCreateFn);
|
||||
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 { makeIoTsConfigParser } from "../../pluginUtils";
|
||||
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { ArchiveChannelCmd } from "./commands/ArchiveChannelCmd";
|
||||
import { ChannelArchiverPluginType } from "./types";
|
||||
|
||||
const ConfigSchema = t.type({});
|
||||
|
||||
export const ChannelArchiverPlugin = zeppelinGuildPlugin<ChannelArchiverPluginType>()({
|
||||
name: "channel_archiver",
|
||||
showInDocs: false,
|
||||
|
||||
dependencies: () => [TimeAndDatePlugin],
|
||||
configSchema: t.type({}),
|
||||
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||
|
||||
// prettier-ignore
|
||||
messageCommands: [
|
||||
ArchiveChannelCmd,
|
||||
],
|
||||
|
||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
||||
configParser: (o: any) => o,
|
||||
});
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { CooldownManager } from "knub";
|
||||
import { GuildLogs } from "../../data/GuildLogs";
|
||||
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||
import { trimPluginDescription } from "../../utils";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
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,
|
||||
they'll get channel permissions applied to them for the text channels.
|
||||
`),
|
||||
configSchema: ConfigSchema,
|
||||
},
|
||||
|
||||
dependencies: () => [LogsPlugin],
|
||||
configSchema: ConfigSchema,
|
||||
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||
defaultOptions,
|
||||
|
||||
events: [VoiceStateUpdateEvt],
|
||||
|
@ -37,7 +39,4 @@ export const CompanionChannelsPlugin = zeppelinGuildPlugin<CompanionChannelsPlug
|
|||
afterLoad(pluginData) {
|
||||
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 { GuildContextMenuLinks } from "../../data/GuildContextMenuLinks";
|
||||
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { MutesPlugin } from "../Mutes/MutesPlugin";
|
||||
import { UtilityPlugin } from "../Utility/UtilityPlugin";
|
||||
|
@ -35,8 +36,8 @@ export const ContextMenuPlugin = zeppelinGuildPlugin<ContextMenuPluginType>()({
|
|||
name: "context_menu",
|
||||
showInDocs: false,
|
||||
|
||||
configSchema: ConfigSchema,
|
||||
dependencies: () => [MutesPlugin, LogsPlugin, UtilityPlugin],
|
||||
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
|
@ -53,7 +54,4 @@ export const ContextMenuPlugin = zeppelinGuildPlugin<ContextMenuPluginType>()({
|
|||
afterLoad(pluginData) {
|
||||
loadAllCommands(pluginData);
|
||||
},
|
||||
|
||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
||||
configParser: (o: any) => o,
|
||||
});
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { EventEmitter } from "events";
|
||||
import * as t from "io-ts";
|
||||
import { PluginOptions } from "knub";
|
||||
import {
|
||||
buildCounterConditionString,
|
||||
|
@ -9,7 +10,7 @@ import {
|
|||
import { GuildCounters } from "../../data/GuildCounters";
|
||||
import { mapToPublicFn } from "../../pluginUtils";
|
||||
import { convertDelayStringToMS, MINUTES } from "../../utils";
|
||||
import { StrictValidationError } from "../../validatorUtils";
|
||||
import { StrictValidationError, validate } from "../../validatorUtils";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { AddCounterCmd } from "./commands/AddCounterCmd";
|
||||
import { CountersListCmd } from "./commands/CountersListCmd";
|
||||
|
@ -72,12 +73,13 @@ export const CountersPlugin = zeppelinGuildPlugin<CountersPluginType>()({
|
|||
description:
|
||||
"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>",
|
||||
configSchema: ConfigSchema,
|
||||
},
|
||||
|
||||
configSchema: ConfigSchema,
|
||||
defaultOptions,
|
||||
configParser: (options) => {
|
||||
for (const [counterName, counter] of Object.entries(options.counters || {})) {
|
||||
// TODO: Separate input and output types
|
||||
configParser: (input) => {
|
||||
for (const [counterName, counter] of Object.entries<any>((input as any).counters || {})) {
|
||||
counter.name = counterName;
|
||||
counter.per_user = counter.per_user ?? false;
|
||||
counter.per_channel = counter.per_channel ?? false;
|
||||
|
@ -90,7 +92,7 @@ export const CountersPlugin = zeppelinGuildPlugin<CountersPluginType>()({
|
|||
|
||||
// Normalize 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;
|
||||
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`]);
|
||||
}
|
||||
|
||||
// FIXME: Any typing
|
||||
return <any>options;
|
||||
const error = validate(ConfigSchema, input);
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
return input as t.TypeOf<typeof ConfigSchema>;
|
||||
},
|
||||
|
||||
public: {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Snowflake, TextChannel } from "discord.js";
|
||||
import { guildPluginMessageCommand } from "knub";
|
||||
import { waitForReply } from "knub/dist/helpers";
|
||||
import { waitForReply } from "knub/helpers";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { sendErrorMessage } from "../../../pluginUtils";
|
||||
import { resolveUser, UnknownUser } from "../../../utils";
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Snowflake, TextChannel } from "discord.js";
|
||||
import { guildPluginMessageCommand } from "knub";
|
||||
import { waitForReply } from "knub/dist/helpers";
|
||||
import { waitForReply } from "knub/helpers";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { sendErrorMessage } from "../../../pluginUtils";
|
||||
import { resolveUser, UnknownUser } from "../../../utils";
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Snowflake, TextChannel } from "discord.js";
|
||||
import { guildPluginMessageCommand } from "knub";
|
||||
import { waitForReply } from "knub/dist/helpers";
|
||||
import { waitForReply } from "knub/helpers";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { sendErrorMessage } from "../../../pluginUtils";
|
||||
import { resolveUser, UnknownUser } from "../../../utils";
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Snowflake } from "discord.js";
|
||||
import { guildPluginMessageCommand } from "knub";
|
||||
import { waitForReply } from "knub/dist/helpers";
|
||||
import { waitForReply } from "knub/helpers";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { sendErrorMessage } from "../../../pluginUtils";
|
||||
import { resolveUser, UnknownUser } from "../../../utils";
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { GuildChannel, GuildMember, User } from "discord.js";
|
||||
import { guildPluginMessageCommand, parseSignature } from "knub";
|
||||
import { commandTypes } from "../../commandTypes";
|
||||
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||
import { createTypedTemplateSafeValueContainer, TemplateSafeValueContainer } from "../../templateFormatter";
|
||||
import { UnknownUser } from "../../utils";
|
||||
import { isScalar } from "../../utils/isScalar";
|
||||
|
@ -24,7 +25,7 @@ export const CustomEventsPlugin = zeppelinGuildPlugin<CustomEventsPluginType>()(
|
|||
name: "custom_events",
|
||||
showInDocs: false,
|
||||
|
||||
configSchema: ConfigSchema,
|
||||
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||
defaultOptions,
|
||||
|
||||
afterLoad(pluginData) {
|
||||
|
@ -67,7 +68,4 @@ export const CustomEventsPlugin = zeppelinGuildPlugin<CustomEventsPluginType>()(
|
|||
beforeUnload() {
|
||||
// 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 { Configs } from "../../data/Configs";
|
||||
import { env } from "../../env";
|
||||
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||
import { zeppelinGlobalPlugin } from "../ZeppelinPluginBlueprint";
|
||||
|
||||
interface GuildAccessMonitorPluginType extends BasePluginType {
|
||||
|
@ -26,7 +27,7 @@ async function checkGuild(pluginData: GlobalPluginData<GuildAccessMonitorPluginT
|
|||
*/
|
||||
export const GuildAccessMonitorPlugin = zeppelinGlobalPlugin<GuildAccessMonitorPluginType>()({
|
||||
name: "guild_access_monitor",
|
||||
configSchema: t.type({}),
|
||||
configParser: makeIoTsConfigParser(t.type({})),
|
||||
|
||||
events: [
|
||||
globalPluginEventListener<GuildAccessMonitorPluginType>()({
|
||||
|
@ -59,7 +60,4 @@ export const GuildAccessMonitorPlugin = zeppelinGlobalPlugin<GuildAccessMonitorP
|
|||
checkGuild(pluginData, guild);
|
||||
}
|
||||
},
|
||||
|
||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
||||
configParser: (o: any) => o,
|
||||
});
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import * as t from "io-ts";
|
||||
import { Configs } from "../../data/Configs";
|
||||
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||
import { zeppelinGlobalPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { reloadChangedGuilds } from "./functions/reloadChangedGuilds";
|
||||
import { GuildConfigReloaderPluginType } from "./types";
|
||||
|
@ -8,7 +9,7 @@ export const GuildConfigReloaderPlugin = zeppelinGlobalPlugin<GuildConfigReloade
|
|||
name: "guild_config_reloader",
|
||||
showInDocs: false,
|
||||
|
||||
configSchema: t.type({}),
|
||||
configParser: makeIoTsConfigParser(t.type({})),
|
||||
|
||||
async beforeLoad(pluginData) {
|
||||
const { state } = pluginData;
|
||||
|
@ -25,7 +26,4 @@ export const GuildConfigReloaderPlugin = zeppelinGlobalPlugin<GuildConfigReloade
|
|||
clearTimeout(pluginData.state.nextCheckTimeout);
|
||||
pluginData.state.unloaded = true;
|
||||
},
|
||||
|
||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
||||
configParser: (o: any) => o,
|
||||
});
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
import { BasePluginType } from "knub";
|
||||
import { Configs } from "../../data/Configs";
|
||||
import { TConfigSchema } from "../Mutes/types";
|
||||
import Timeout = NodeJS.Timeout;
|
||||
|
||||
export interface GuildConfigReloaderPluginType extends BasePluginType {
|
||||
config: TConfigSchema;
|
||||
config: {};
|
||||
state: {
|
||||
guildConfigs: Configs;
|
||||
unloaded: boolean;
|
||||
|
|
|
@ -3,6 +3,7 @@ import * as t from "io-ts";
|
|||
import { guildPluginEventListener } from "knub";
|
||||
import { AllowedGuilds } from "../../data/AllowedGuilds";
|
||||
import { ApiPermissionAssignments } from "../../data/ApiPermissionAssignments";
|
||||
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||
import { MINUTES } from "../../utils";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { GuildInfoSaverPluginType } from "./types";
|
||||
|
@ -11,7 +12,7 @@ export const GuildInfoSaverPlugin = zeppelinGuildPlugin<GuildInfoSaverPluginType
|
|||
name: "guild_info_saver",
|
||||
showInDocs: false,
|
||||
|
||||
configSchema: t.type({}),
|
||||
configParser: makeIoTsConfigParser(t.type({})),
|
||||
|
||||
events: [
|
||||
guildPluginEventListener({
|
||||
|
@ -30,9 +31,6 @@ export const GuildInfoSaverPlugin = zeppelinGuildPlugin<GuildInfoSaverPluginType
|
|||
beforeUnload(pluginData) {
|
||||
clearInterval(pluginData.state.updateInterval);
|
||||
},
|
||||
|
||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
||||
configParser: (o: any) => o,
|
||||
});
|
||||
|
||||
async function updateGuildInfo(guild: Guild) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { PluginOptions } from "knub";
|
||||
import { Webhooks } from "../../data/Webhooks";
|
||||
import { mapToPublicFn } from "../../pluginUtils";
|
||||
import { makeIoTsConfigParser, mapToPublicFn } from "../../pluginUtils";
|
||||
import { Queue } from "../../Queue";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { editMessage } from "./functions/editMessage";
|
||||
|
@ -16,7 +16,7 @@ export const InternalPosterPlugin = zeppelinGuildPlugin<InternalPosterPluginType
|
|||
name: "internal_poster",
|
||||
showInDocs: false,
|
||||
|
||||
configSchema: ConfigSchema,
|
||||
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
|
@ -33,7 +33,4 @@ export const InternalPosterPlugin = zeppelinGuildPlugin<InternalPosterPluginType
|
|||
state.missingPermissions = false;
|
||||
state.webhookClientCache = new Map();
|
||||
},
|
||||
|
||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
||||
configParser: (o: any) => o,
|
||||
});
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { PluginOptions } from "knub";
|
||||
import { onGuildEvent } from "../../data/GuildEvents";
|
||||
import { GuildVCAlerts } from "../../data/GuildVCAlerts";
|
||||
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||
import { trimPluginDescription } from "../../utils";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
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
|
||||
* Be notified as soon as a user switches or joins a voice channel
|
||||
`),
|
||||
configSchema: ConfigSchema,
|
||||
},
|
||||
|
||||
configSchema: ConfigSchema,
|
||||
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
|
@ -78,7 +80,4 @@ export const LocateUserPlugin = zeppelinGuildPlugin<LocateUserPluginType>()({
|
|||
|
||||
state.unregisterGuildEventListener?.();
|
||||
},
|
||||
|
||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
||||
configParser: (o: any) => o,
|
||||
});
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { GuildMember, GuildTextBasedChannel, Invite, VoiceChannel } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { getInviteLink } from "knub/dist/helpers";
|
||||
import { getInviteLink } from "knub/helpers";
|
||||
import { sendErrorMessage } from "../../../pluginUtils";
|
||||
import { LocateUserPluginType } from "../types";
|
||||
import { createOrReuseInvite } from "./createOrReuseInvite";
|
||||
|
|
|
@ -6,7 +6,7 @@ import { GuildLogs } from "../../data/GuildLogs";
|
|||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||
import { LogType } from "../../data/LogType";
|
||||
import { logger } from "../../logger";
|
||||
import { mapToPublicFn } from "../../pluginUtils";
|
||||
import { makeIoTsConfigParser, mapToPublicFn } from "../../pluginUtils";
|
||||
import { discardRegExpRunner, getRegExpRunner } from "../../regExpRunners";
|
||||
import { createTypedTemplateSafeValueContainer, TypedTemplateSafeValueContainer } from "../../templateFormatter";
|
||||
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
||||
|
@ -110,6 +110,11 @@ import { logVoiceChannelJoin } from "./logFunctions/logVoiceChannelJoin";
|
|||
import { logVoiceChannelLeave } from "./logFunctions/logVoiceChannelLeave";
|
||||
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> = {
|
||||
config: {
|
||||
channels: {},
|
||||
|
@ -138,15 +143,11 @@ export const LogsPlugin = zeppelinGuildPlugin<LogsPluginType>()({
|
|||
showInDocs: true,
|
||||
info: {
|
||||
prettyName: "Logs",
|
||||
configSchema: ConfigSchema,
|
||||
},
|
||||
|
||||
dependencies: async () => [
|
||||
TimeAndDatePlugin,
|
||||
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,
|
||||
dependencies: async () => [TimeAndDatePlugin, InternalPosterPlugin, (await getCasesPlugin()).CasesPlugin],
|
||||
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||
defaultOptions,
|
||||
|
||||
events: [
|
||||
|
@ -326,7 +327,4 @@ export const LogsPlugin = zeppelinGuildPlugin<LogsPluginType>()({
|
|||
}
|
||||
discardRegExpRunner(`guild-${guild.id}`);
|
||||
},
|
||||
|
||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
||||
configParser: (o: any) => o,
|
||||
});
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { GuildTextBasedChannel, User } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { deactivateMentions, disableCodeBlocks } from "knub/dist/helpers";
|
||||
import { deactivateMentions, disableCodeBlocks } from "knub/helpers";
|
||||
import { resolveChannelIds } from "src/utils/resolveChannelIds";
|
||||
import { SavedMessage } from "../../../data/entities/SavedMessage";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { PluginOptions } from "knub";
|
||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { SaveMessagesToDBCmd } from "./commands/SaveMessagesToDB";
|
||||
import { SavePinsToDBCmd } from "./commands/SavePinsToDB";
|
||||
|
@ -24,7 +25,7 @@ export const MessageSaverPlugin = zeppelinGuildPlugin<MessageSaverPluginType>()(
|
|||
name: "message_saver",
|
||||
showInDocs: false,
|
||||
|
||||
configSchema: ConfigSchema,
|
||||
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
|
@ -45,7 +46,4 @@ export const MessageSaverPlugin = zeppelinGuildPlugin<MessageSaverPluginType>()(
|
|||
const { state, guild } = pluginData;
|
||||
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 { GuildMutes } from "../../data/GuildMutes";
|
||||
import { GuildTempbans } from "../../data/GuildTempbans";
|
||||
import { mapToPublicFn } from "../../pluginUtils";
|
||||
import { makeIoTsConfigParser, mapToPublicFn } from "../../pluginUtils";
|
||||
import { Queue } from "../../Queue";
|
||||
import { MINUTES, trimPluginDescription } from "../../utils";
|
||||
import { CasesPlugin } from "../Cases/CasesPlugin";
|
||||
|
@ -120,10 +120,11 @@ export const ModActionsPlugin = zeppelinGuildPlugin<ModActionsPluginType>()({
|
|||
description: trimPluginDescription(`
|
||||
This plugin contains the 'typical' mod actions such as warning, muting, kicking, banning, etc.
|
||||
`),
|
||||
configSchema: ConfigSchema,
|
||||
},
|
||||
|
||||
dependencies: () => [TimeAndDatePlugin, CasesPlugin, MutesPlugin, LogsPlugin],
|
||||
configSchema: ConfigSchema,
|
||||
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||
defaultOptions,
|
||||
|
||||
events: [CreateBanCaseOnManualBanEvt, CreateUnbanCaseOnManualUnbanEvt, PostAlertOnMemberJoinEvt],
|
||||
|
@ -223,7 +224,4 @@ export const ModActionsPlugin = zeppelinGuildPlugin<ModActionsPluginType>()({
|
|||
state.unregisterGuildEventListener?.();
|
||||
state.events.removeAllListeners();
|
||||
},
|
||||
|
||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
||||
configParser: (o: any) => o,
|
||||
});
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import humanizeDuration from "humanize-duration";
|
||||
import { getMemberLevel } from "knub/dist/helpers";
|
||||
import { getMemberLevel } from "knub/helpers";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { clearExpiringTempban, registerExpiringTempban } from "../../../data/loops/expiringTempbansLoop";
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Snowflake } from "discord.js";
|
||||
import { waitForReply } from "knub/dist/helpers";
|
||||
import { waitForReply } from "knub/helpers";
|
||||
import { performance } from "perf_hooks";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Snowflake } from "discord.js";
|
||||
import { waitForReply } from "knub/dist/helpers";
|
||||
import { waitForReply } from "knub/helpers";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Snowflake } from "discord.js";
|
||||
import { waitForReply } from "knub/dist/helpers";
|
||||
import { waitForReply } from "knub/helpers";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { logger } from "../../../logger";
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { GuildMember, GuildTextBasedChannel } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { hasPermission } from "knub/dist/helpers";
|
||||
import { hasPermission } from "knub/helpers";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { DAYS, errorMessage, resolveMember, resolveUser, SECONDS } from "../../../utils";
|
||||
|
|
|
@ -5,7 +5,7 @@ import { GuildCases } from "../../data/GuildCases";
|
|||
import { onGuildEvent } from "../../data/GuildEvents";
|
||||
import { GuildLogs } from "../../data/GuildLogs";
|
||||
import { GuildMutes } from "../../data/GuildMutes";
|
||||
import { mapToPublicFn } from "../../pluginUtils";
|
||||
import { makeIoTsConfigParser, mapToPublicFn } from "../../pluginUtils";
|
||||
import { CasesPlugin } from "../Cases/CasesPlugin";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
|
@ -65,10 +65,11 @@ export const MutesPlugin = zeppelinGuildPlugin<MutesPluginType>()({
|
|||
showInDocs: true,
|
||||
info: {
|
||||
prettyName: "Mutes",
|
||||
configSchema: ConfigSchema,
|
||||
},
|
||||
|
||||
configSchema: ConfigSchema,
|
||||
dependencies: () => [CasesPlugin, LogsPlugin],
|
||||
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
|
@ -126,7 +127,4 @@ export const MutesPlugin = zeppelinGuildPlugin<MutesPluginType>()({
|
|||
state.unregisterGuildEventListener?.();
|
||||
state.events.removeAllListeners();
|
||||
},
|
||||
|
||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
||||
configParser: (o: any) => o,
|
||||
});
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { PluginOptions } from "knub";
|
||||
import { GuildNicknameHistory } from "../../data/GuildNicknameHistory";
|
||||
import { UsernameHistory } from "../../data/UsernameHistory";
|
||||
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||
import { Queue } from "../../Queue";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { NamesCmd } from "./commands/NamesCmd";
|
||||
|
@ -24,7 +25,7 @@ export const NameHistoryPlugin = zeppelinGuildPlugin<NameHistoryPluginType>()({
|
|||
name: "name_history",
|
||||
showInDocs: false,
|
||||
|
||||
configSchema: ConfigSchema,
|
||||
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
|
@ -46,7 +47,4 @@ export const NameHistoryPlugin = zeppelinGuildPlugin<NameHistoryPluginType>()({
|
|||
state.usernameHistory = new UsernameHistory();
|
||||
state.updateQueue = new Queue();
|
||||
},
|
||||
|
||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
||||
configParser: (o: any) => o,
|
||||
});
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
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 { NICKNAME_RETENTION_PERIOD } from "../../../data/cleanup/nicknames";
|
||||
import { MAX_NICKNAME_ENTRIES_PER_USER } from "../../../data/GuildNicknameHistory";
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { PluginOptions } from "knub";
|
||||
import { GuildLogs } from "../../data/GuildLogs";
|
||||
import { GuildPersistedData } from "../../data/GuildPersistedData";
|
||||
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||
import { trimPluginDescription } from "../../utils";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
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.
|
||||
Mute roles are re-applied automatically, this plugin is not required for that.
|
||||
`),
|
||||
configSchema: ConfigSchema,
|
||||
},
|
||||
|
||||
dependencies: () => [LogsPlugin],
|
||||
configSchema: ConfigSchema,
|
||||
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
|
@ -43,7 +45,4 @@ export const PersistPlugin = zeppelinGuildPlugin<PersistPluginType>()({
|
|||
state.persistedData = GuildPersistedData.getGuildInstance(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 { hasPhishermanMasterAPIKey, phishermanApiKeyIsValid } from "../../data/Phisherman";
|
||||
import { mapToPublicFn } from "../../pluginUtils";
|
||||
import { makeIoTsConfigParser, mapToPublicFn } from "../../pluginUtils";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { getDomainInfo } from "./functions/getDomainInfo";
|
||||
import { pluginInfo } from "./info";
|
||||
|
@ -18,7 +18,7 @@ export const PhishermanPlugin = zeppelinGuildPlugin<PhishermanPluginType>()({
|
|||
showInDocs: true,
|
||||
info: pluginInfo,
|
||||
|
||||
configSchema: ConfigSchema,
|
||||
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||
defaultOptions,
|
||||
|
||||
// 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 { ZeppelinGuildPluginBlueprint } from "../ZeppelinPluginBlueprint";
|
||||
import { ConfigSchema } from "./types";
|
||||
|
||||
export const pluginInfo: ZeppelinGuildPluginBlueprint["info"] = {
|
||||
prettyName: "Phisherman",
|
||||
|
@ -38,4 +39,5 @@ export const pluginInfo: ZeppelinGuildPluginBlueprint["info"] = {
|
|||
clean: true
|
||||
~~~
|
||||
`),
|
||||
configSchema: ConfigSchema,
|
||||
};
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { PluginOptions } from "knub";
|
||||
import { GuildPingableRoles } from "../../data/GuildPingableRoles";
|
||||
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { PingableRoleDisableCmd } from "./commands/PingableRoleDisableCmd";
|
||||
import { PingableRoleEnableCmd } from "./commands/PingableRoleEnableCmd";
|
||||
|
@ -24,9 +25,10 @@ export const PingableRolesPlugin = zeppelinGuildPlugin<PingableRolesPluginType>(
|
|||
showInDocs: true,
|
||||
info: {
|
||||
prettyName: "Pingable roles",
|
||||
configSchema: ConfigSchema,
|
||||
},
|
||||
|
||||
configSchema: ConfigSchema,
|
||||
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
|
@ -49,7 +51,4 @@ export const PingableRolesPlugin = zeppelinGuildPlugin<PingableRolesPluginType>(
|
|||
state.cache = 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 { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||
import { GuildScheduledPosts } from "../../data/GuildScheduledPosts";
|
||||
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
|
@ -35,10 +36,11 @@ export const PostPlugin = zeppelinGuildPlugin<PostPluginType>()({
|
|||
showInDocs: true,
|
||||
info: {
|
||||
prettyName: "Post",
|
||||
configSchema: ConfigSchema,
|
||||
},
|
||||
|
||||
dependencies: () => [TimeAndDatePlugin, LogsPlugin],
|
||||
configSchema: ConfigSchema,
|
||||
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
|
@ -73,7 +75,4 @@ export const PostPlugin = zeppelinGuildPlugin<PostPluginType>()({
|
|||
|
||||
state.unregisterGuildEventListener?.();
|
||||
},
|
||||
|
||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
||||
configParser: (o: any) => o,
|
||||
});
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { PluginOptions } from "knub";
|
||||
import { GuildReactionRoles } from "../../data/GuildReactionRoles";
|
||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||
import { Queue } from "../../Queue";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
|
@ -39,10 +40,11 @@ export const ReactionRolesPlugin = zeppelinGuildPlugin<ReactionRolesPluginType>(
|
|||
info: {
|
||||
prettyName: "Reaction roles",
|
||||
legacy: "Consider using the [Role buttons](/docs/plugins/role_buttons) plugin instead.",
|
||||
configSchema: ConfigSchema,
|
||||
},
|
||||
|
||||
dependencies: () => [LogsPlugin],
|
||||
configSchema: ConfigSchema,
|
||||
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
|
@ -85,7 +87,4 @@ export const ReactionRolesPlugin = zeppelinGuildPlugin<ReactionRolesPluginType>(
|
|||
clearTimeout(state.autoRefreshTimeout);
|
||||
}
|
||||
},
|
||||
|
||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
||||
configParser: (o: any) => o,
|
||||
});
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { PluginOptions } from "knub";
|
||||
import { onGuildEvent } from "../../data/GuildEvents";
|
||||
import { GuildReminders } from "../../data/GuildReminders";
|
||||
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { RemindCmd } from "./commands/RemindCmd";
|
||||
|
@ -28,10 +29,11 @@ export const RemindersPlugin = zeppelinGuildPlugin<RemindersPluginType>()({
|
|||
showInDocs: true,
|
||||
info: {
|
||||
prettyName: "Reminders",
|
||||
configSchema: ConfigSchema,
|
||||
},
|
||||
|
||||
dependencies: () => [TimeAndDatePlugin],
|
||||
configSchema: ConfigSchema,
|
||||
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
|
@ -63,7 +65,4 @@ export const RemindersPlugin = zeppelinGuildPlugin<RemindersPluginType>()({
|
|||
state.unregisterGuildEventListener?.();
|
||||
state.unloaded = true;
|
||||
},
|
||||
|
||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
||||
configParser: (o: any) => o,
|
||||
});
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { HTTPError, Snowflake } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { disableLinkPreviews } from "knub/dist/helpers";
|
||||
import { disableLinkPreviews } from "knub/helpers";
|
||||
import moment from "moment-timezone";
|
||||
import { Reminder } from "../../../data/entities/Reminder";
|
||||
import { DBDateFormat } from "../../../utils";
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import * as t from "io-ts";
|
||||
import { GuildRoleButtons } from "../../data/GuildRoleButtons";
|
||||
import { StrictValidationError } from "../../validatorUtils";
|
||||
import { StrictValidationError, validate } from "../../validatorUtils";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { RoleManagerPlugin } from "../RoleManager/RoleManagerPlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
|
@ -13,7 +14,6 @@ import { ConfigSchema, RoleButtonsPluginType } from "./types";
|
|||
|
||||
export const RoleButtonsPlugin = zeppelinGuildPlugin<RoleButtonsPluginType>()({
|
||||
name: "role_buttons",
|
||||
configSchema: ConfigSchema,
|
||||
info: pluginInfo,
|
||||
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
|
||||
const buttonsArray = Array.isArray(options.buttons) ? options.buttons : [];
|
||||
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) {
|
||||
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
|
||||
return <any>options;
|
||||
const error = validate(ConfigSchema, input);
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
return input as t.TypeOf<typeof ConfigSchema>;
|
||||
},
|
||||
|
||||
dependencies: () => [LogsPlugin, RoleManagerPlugin],
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { trimPluginDescription } from "../../utils";
|
||||
import { ZeppelinGuildPluginBlueprint } from "../ZeppelinPluginBlueprint";
|
||||
import { ConfigSchema } from "./types";
|
||||
|
||||
export const pluginInfo: ZeppelinGuildPluginBlueprint["info"] = {
|
||||
prettyName: "Role buttons",
|
||||
|
@ -77,4 +78,5 @@ export const pluginInfo: ZeppelinGuildPluginBlueprint["info"] = {
|
|||
... # See above for examples for options
|
||||
~~~
|
||||
`),
|
||||
configSchema: ConfigSchema,
|
||||
};
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { GuildRoleQueue } from "../../data/GuildRoleQueue";
|
||||
import { mapToPublicFn } from "../../pluginUtils";
|
||||
import { makeIoTsConfigParser, mapToPublicFn } from "../../pluginUtils";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { addPriorityRole } from "./functions/addPriorityRole";
|
||||
|
@ -11,10 +11,10 @@ import { ConfigSchema, RoleManagerPluginType } from "./types";
|
|||
|
||||
export const RoleManagerPlugin = zeppelinGuildPlugin<RoleManagerPluginType>()({
|
||||
name: "role_manager",
|
||||
configSchema: ConfigSchema,
|
||||
showInDocs: false,
|
||||
|
||||
dependencies: () => [LogsPlugin],
|
||||
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||
|
||||
public: {
|
||||
addRole: mapToPublicFn(addRole),
|
||||
|
@ -40,7 +40,4 @@ export const RoleManagerPlugin = zeppelinGuildPlugin<RoleManagerPluginType>()({
|
|||
state.abortRoleAssignmentLoop = true;
|
||||
await state.pendingRoleAssignmentPromise;
|
||||
},
|
||||
|
||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
||||
configParser: (o: any) => o,
|
||||
});
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { PluginOptions } from "knub";
|
||||
import { GuildLogs } from "../../data/GuildLogs";
|
||||
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||
import { trimPluginDescription } from "../../utils";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
|
@ -39,10 +40,11 @@ export const RolesPlugin = zeppelinGuildPlugin<RolesPluginType>()({
|
|||
description: trimPluginDescription(`
|
||||
Enables authorised users to add and remove whitelisted roles with a command.
|
||||
`),
|
||||
configSchema: ConfigSchema,
|
||||
},
|
||||
|
||||
configSchema: ConfigSchema,
|
||||
dependencies: () => [LogsPlugin],
|
||||
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
|
@ -58,7 +60,4 @@ export const RolesPlugin = zeppelinGuildPlugin<RolesPluginType>()({
|
|||
|
||||
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 { trimPluginDescription } from "../../utils";
|
||||
import { validate } from "../../validatorUtils";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { RoleAddCmd } from "./commands/RoleAddCmd";
|
||||
import { RoleHelpCmd } from "./commands/RoleHelpCmd";
|
||||
|
@ -17,9 +19,6 @@ export const SelfGrantableRolesPlugin = zeppelinGuildPlugin<SelfGrantableRolesPl
|
|||
name: "self_grantable_roles",
|
||||
showInDocs: true,
|
||||
|
||||
configSchema: ConfigSchema,
|
||||
defaultOptions,
|
||||
|
||||
info: {
|
||||
prettyName: "Self-grantable roles",
|
||||
description: trimPluginDescription(`
|
||||
|
@ -68,24 +67,31 @@ export const SelfGrantableRolesPlugin = zeppelinGuildPlugin<SelfGrantableRolesPl
|
|||
can_use: true
|
||||
~~~
|
||||
`),
|
||||
configSchema: ConfigSchema,
|
||||
},
|
||||
|
||||
configParser: (options) => {
|
||||
const config = options;
|
||||
for (const [key, entry] of Object.entries(config.entries)) {
|
||||
configParser: (input) => {
|
||||
const entries = (input as any).entries;
|
||||
for (const [key, entry] of Object.entries<any>(entries)) {
|
||||
// Apply default entry config
|
||||
config.entries[key] = { ...defaultSelfGrantableRoleEntry, ...entry };
|
||||
entries[key] = { ...defaultSelfGrantableRoleEntry, ...entry };
|
||||
|
||||
// Normalize alias names
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return { ...options, config };
|
||||
const error = validate(ConfigSchema, input);
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
return input as t.TypeOf<typeof ConfigSchema>;
|
||||
},
|
||||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
messageCommands: [
|
||||
|
|
|
@ -2,6 +2,7 @@ import { PluginOptions } from "knub";
|
|||
import { GuildLogs } from "../../data/GuildLogs";
|
||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||
import { GuildSlowmodes } from "../../data/GuildSlowmodes";
|
||||
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||
import { SECONDS } from "../../utils";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
|
@ -40,6 +41,7 @@ export const SlowmodePlugin = zeppelinGuildPlugin<SlowmodePluginType>()({
|
|||
showInDocs: true,
|
||||
info: {
|
||||
prettyName: "Slowmode",
|
||||
configSchema: ConfigSchema,
|
||||
},
|
||||
|
||||
// prettier-ignore
|
||||
|
@ -47,7 +49,7 @@ export const SlowmodePlugin = zeppelinGuildPlugin<SlowmodePluginType>()({
|
|||
LogsPlugin,
|
||||
],
|
||||
|
||||
configSchema: ConfigSchema,
|
||||
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
|
@ -84,7 +86,4 @@ export const SlowmodePlugin = zeppelinGuildPlugin<SlowmodePluginType>()({
|
|||
state.savedMessages.events.off("create", state.onMessageCreateFn);
|
||||
clearInterval(state.clearInterval);
|
||||
},
|
||||
|
||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
||||
configParser: (o: any) => o,
|
||||
});
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { GuildChannel, TextChannel } from "discord.js";
|
||||
import humanizeDuration from "humanize-duration";
|
||||
import { createChunkedMessage } from "knub/dist/helpers";
|
||||
import { createChunkedMessage } from "knub/helpers";
|
||||
import { errorMessage } from "../../../utils";
|
||||
import { slowmodeCmd } from "../types";
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ import { GuildArchives } from "../../data/GuildArchives";
|
|||
import { GuildLogs } from "../../data/GuildLogs";
|
||||
import { GuildMutes } from "../../data/GuildMutes";
|
||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||
import { trimPluginDescription } from "../../utils";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
|
@ -52,11 +53,11 @@ export const SpamPlugin = zeppelinGuildPlugin<SpamPluginType>()({
|
|||
For more advanced spam filtering, check out the Automod plugin!
|
||||
`),
|
||||
legacy: true,
|
||||
configSchema: ConfigSchema,
|
||||
},
|
||||
|
||||
dependencies: () => [LogsPlugin],
|
||||
|
||||
configSchema: ConfigSchema,
|
||||
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
|
@ -92,7 +93,4 @@ export const SpamPlugin = zeppelinGuildPlugin<SpamPluginType>()({
|
|||
state.savedMessages.events.off("create", state.onMessageCreateFn);
|
||||
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 { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||
import { GuildStarboardMessages } from "../../data/GuildStarboardMessages";
|
||||
import { GuildStarboardReactions } from "../../data/GuildStarboardReactions";
|
||||
import { trimPluginDescription } from "../../utils";
|
||||
import { validate } from "../../validatorUtils";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { MigratePinsCmd } from "./commands/MigratePinsCmd";
|
||||
import { StarboardReactionAddEvt } from "./events/StarboardReactionAddEvt";
|
||||
|
@ -30,9 +32,6 @@ export const StarboardPlugin = zeppelinGuildPlugin<StarboardPluginType>()({
|
|||
name: "starboard",
|
||||
showInDocs: true,
|
||||
|
||||
configSchema: ConfigSchema,
|
||||
defaultOptions,
|
||||
|
||||
info: {
|
||||
prettyName: "Starboard",
|
||||
description: trimPluginDescription(`
|
||||
|
@ -122,18 +121,25 @@ export const StarboardPlugin = zeppelinGuildPlugin<StarboardPluginType>()({
|
|||
enabled: true
|
||||
~~~
|
||||
`),
|
||||
configSchema: ConfigSchema,
|
||||
},
|
||||
|
||||
configParser(options) {
|
||||
if (options.boards) {
|
||||
for (const [name, opts] of Object.entries(options.boards)) {
|
||||
options.boards[name] = Object.assign({}, defaultStarboardOpts, options.boards[name]);
|
||||
configParser(input) {
|
||||
const boards = (input as any).boards;
|
||||
if (boards) {
|
||||
for (const [name, opts] of Object.entries(boards)) {
|
||||
boards[name] = Object.assign({}, defaultStarboardOpts, boards[name]);
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: any typing lol
|
||||
return <any>options;
|
||||
const error = validate(ConfigSchema, input);
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
return input as t.TypeOf<typeof ConfigSchema>;
|
||||
},
|
||||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
messageCommands: [
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import { Snowflake } from "discord.js";
|
||||
import humanizeDuration from "humanize-duration";
|
||||
import * as t from "io-ts";
|
||||
import { PluginOptions } from "knub";
|
||||
import moment from "moment-timezone";
|
||||
import { StrictValidationError } from "src/validatorUtils";
|
||||
import { StrictValidationError, validate } from "src/validatorUtils";
|
||||
import { GuildArchives } from "../../data/GuildArchives";
|
||||
import { GuildLogs } from "../../data/GuildLogs";
|
||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||
|
@ -71,9 +72,9 @@ export const TagsPlugin = zeppelinGuildPlugin<TagsPluginType>()({
|
|||
|
||||
${generateTemplateMarkdown(TemplateFunctions)}
|
||||
`),
|
||||
configSchema: ConfigSchema,
|
||||
},
|
||||
|
||||
configSchema: ConfigSchema,
|
||||
dependencies: () => [LogsPlugin],
|
||||
defaultOptions,
|
||||
|
||||
|
@ -96,17 +97,19 @@ export const TagsPlugin = zeppelinGuildPlugin<TagsPluginType>()({
|
|||
findTagByName: mapToPublicFn(findTagByName),
|
||||
},
|
||||
|
||||
configParser(options) {
|
||||
if (options.delete_with_command && options.auto_delete_command) {
|
||||
configParser(_input) {
|
||||
const input = _input as any;
|
||||
|
||||
if (input.delete_with_command && input.auto_delete_command) {
|
||||
throw new StrictValidationError([
|
||||
`Cannot have both (global) delete_with_command and global_delete_invoke enabled`,
|
||||
]);
|
||||
}
|
||||
|
||||
// Check each category for conflicting options
|
||||
if (options.categories) {
|
||||
for (const [name, opts] of Object.entries(options.categories)) {
|
||||
const cat = options.categories[name];
|
||||
if (input.categories) {
|
||||
for (const [name, opts] of Object.entries(input.categories)) {
|
||||
const cat = input.categories[name];
|
||||
if (cat.delete_with_command && cat.auto_delete_command) {
|
||||
throw new StrictValidationError([
|
||||
`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
|
||||
return <any>options;
|
||||
const error = validate(ConfigSchema, input);
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
return input as t.TypeOf<typeof ConfigSchema>;
|
||||
},
|
||||
|
||||
beforeLoad(pluginData) {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import * as t from "io-ts";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { ExtendedMatchParams } from "knub/dist/config/PluginConfigManager";
|
||||
import { ExtendedMatchParams, GuildPluginData } from "knub";
|
||||
import { Tag, TagsPluginType } from "../types";
|
||||
|
||||
export async function findTagByName(
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import { GuildMember } from "discord.js";
|
||||
import escapeStringRegexp from "escape-string-regexp";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { ExtendedMatchParams } from "knub/dist/config/PluginConfigManager";
|
||||
import { ExtendedMatchParams, GuildPluginData } from "knub";
|
||||
import { StrictMessageContent } from "../../../utils";
|
||||
import { TagsPluginType, TTagCategory } from "../types";
|
||||
import { renderTagFromString } from "./renderTagFromString";
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { ExtendedMatchParams } from "knub/dist/config/PluginConfigManager";
|
||||
import { ExtendedMatchParams, GuildPluginData } from "knub";
|
||||
import { renderTemplate, TemplateSafeValue, TemplateSafeValueContainer } from "../../../templateFormatter";
|
||||
import { renderRecursively, StrictMessageContent } from "../../../utils";
|
||||
import { TagsPluginType, TTag } from "../types";
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { PluginOptions } from "knub";
|
||||
import { GuildMemberTimezones } from "../../data/GuildMemberTimezones";
|
||||
import { mapToPublicFn } from "../../pluginUtils";
|
||||
import { makeIoTsConfigParser, mapToPublicFn } from "../../pluginUtils";
|
||||
import { trimPluginDescription } from "../../utils";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { ResetTimezoneCmd } from "./commands/ResetTimezoneCmd";
|
||||
|
@ -39,9 +39,10 @@ export const TimeAndDatePlugin = zeppelinGuildPlugin<TimeAndDatePluginType>()({
|
|||
description: trimPluginDescription(`
|
||||
Allows controlling the displayed time/date formats and timezones
|
||||
`),
|
||||
configSchema: ConfigSchema,
|
||||
},
|
||||
|
||||
configSchema: ConfigSchema,
|
||||
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
|
@ -64,7 +65,4 @@ export const TimeAndDatePlugin = zeppelinGuildPlugin<TimeAndDatePluginType>()({
|
|||
|
||||
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 { UsernameHistory } from "../../data/UsernameHistory";
|
||||
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||
import { Queue } from "../../Queue";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { MessageCreateUpdateUsernameEvt, VoiceChannelJoinUpdateUsernameEvt } from "./events/UpdateUsernameEvts";
|
||||
|
@ -9,7 +10,7 @@ export const UsernameSaverPlugin = zeppelinGuildPlugin<UsernameSaverPluginType>(
|
|||
name: "username_saver",
|
||||
showInDocs: false,
|
||||
|
||||
configSchema: t.type({}),
|
||||
configParser: makeIoTsConfigParser(t.type({})),
|
||||
|
||||
// prettier-ignore
|
||||
events: [
|
||||
|
@ -23,7 +24,4 @@ export const UsernameSaverPlugin = zeppelinGuildPlugin<UsernameSaverPluginType>(
|
|||
state.usernameHistory = new UsernameHistory();
|
||||
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 { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||
import { Supporters } from "../../data/Supporters";
|
||||
import { sendSuccessMessage } from "../../pluginUtils";
|
||||
import { makeIoTsConfigParser, sendSuccessMessage } from "../../pluginUtils";
|
||||
import { discardRegExpRunner, getRegExpRunner } from "../../regExpRunners";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { ModActionsPlugin } from "../ModActions/ModActionsPlugin";
|
||||
|
@ -117,10 +117,11 @@ export const UtilityPlugin = zeppelinGuildPlugin<UtilityPluginType>()({
|
|||
showInDocs: true,
|
||||
info: {
|
||||
prettyName: "Utility",
|
||||
configSchema: ConfigSchema,
|
||||
},
|
||||
|
||||
dependencies: () => [TimeAndDatePlugin, ModActionsPlugin, LogsPlugin],
|
||||
configSchema: ConfigSchema,
|
||||
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
|
@ -221,7 +222,4 @@ export const UtilityPlugin = zeppelinGuildPlugin<UtilityPluginType>()({
|
|||
beforeUnload(pluginData) {
|
||||
discardRegExpRunner(`guild-${pluginData.guild.id}`);
|
||||
},
|
||||
|
||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
||||
configParser: (o: any) => o,
|
||||
});
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { LoadedGuildPlugin } from "knub";
|
||||
import { PluginCommandDefinition } from "knub/dist/commands/commandUtils";
|
||||
import { LoadedGuildPlugin, PluginCommandDefinition } from "knub";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { createChunkedMessage } from "../../../utils";
|
||||
import { utilityCmd } from "../types";
|
||||
|
@ -32,7 +31,6 @@ export const HelpCmd = utilityCmd({
|
|||
if (strTrigger.startsWith(searchStr)) {
|
||||
matchingCommands.push({
|
||||
plugin,
|
||||
// @ts-expect-error
|
||||
command: registeredCommand,
|
||||
});
|
||||
break;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
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 { sendErrorMessage } from "../../../pluginUtils";
|
||||
import { isValidSnowflake, noop, parseInviteCodeInput, resolveInvite, resolveUser } from "../../../utils";
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import { APIEmbed, MessageType, Snowflake, TextChannel } from "discord.js";
|
||||
import humanizeDuration from "humanize-duration";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { getDefaultPrefix } from "knub/dist/commands/commandUtils";
|
||||
import { getDefaultMessageCommandPrefix, GuildPluginData } from "knub";
|
||||
import moment from "moment-timezone";
|
||||
import { chunkMessageLines, EmbedWith, messageLink, preEmbedPadding, trimEmptyLines, trimLines } from "../../../utils";
|
||||
import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin";
|
||||
|
@ -136,8 +135,7 @@ export async function getMessageInfoEmbed(
|
|||
}
|
||||
|
||||
if (message.embeds.length) {
|
||||
// @ts-expect-error
|
||||
const prefix = pluginData.fullConfig.prefix || getDefaultPrefix(pluginData.client);
|
||||
const prefix = pluginData.fullConfig.prefix || getDefaultMessageCommandPrefix(pluginData.client);
|
||||
embed.fields.push({
|
||||
name: preEmbedPadding + "Embeds",
|
||||
value: `Message contains an embed, use \`${prefix}source\` to see the embed source`,
|
||||
|
|
|
@ -10,8 +10,7 @@ import {
|
|||
User,
|
||||
} from "discord.js";
|
||||
import escapeStringRegexp from "escape-string-regexp";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { ArgsFromSignatureOrArray } from "knub/dist/commands/commandUtils";
|
||||
import { ArgsFromSignatureOrArray, GuildPluginData } from "knub";
|
||||
import moment from "moment-timezone";
|
||||
import { getBaseUrl, sendErrorMessage } from "../../pluginUtils";
|
||||
import { allowTimeout, RegExpRunner } from "../../RegExpRunner";
|
||||
|
@ -192,6 +191,7 @@ export async function displaySearch(
|
|||
if (msg.author.id !== interaction.user.id) {
|
||||
interaction
|
||||
.reply({ content: `You are not permitted to use these buttons.`, ephemeral: true })
|
||||
// tslint:disable-next-line no-console
|
||||
.catch((err) => console.trace(err.message));
|
||||
} else {
|
||||
if (interaction.customId === `previousButton:${idMod}` && currentPage > 1) {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { PluginOptions } from "knub";
|
||||
import { GuildLogs } from "../../data/GuildLogs";
|
||||
import { makeIoTsConfigParser } from "../../pluginUtils";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { SendWelcomeMessageEvt } from "./events/SendWelcomeMessageEvt";
|
||||
|
@ -18,10 +19,11 @@ export const WelcomeMessagePlugin = zeppelinGuildPlugin<WelcomeMessagePluginType
|
|||
showInDocs: true,
|
||||
info: {
|
||||
prettyName: "Welcome message",
|
||||
configSchema: ConfigSchema,
|
||||
},
|
||||
|
||||
configSchema: ConfigSchema,
|
||||
dependencies: () => [LogsPlugin],
|
||||
configParser: makeIoTsConfigParser(ConfigSchema),
|
||||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
|
@ -35,7 +37,4 @@ export const WelcomeMessagePlugin = zeppelinGuildPlugin<WelcomeMessagePluginType
|
|||
state.logs = new GuildLogs(guild.id);
|
||||
state.sentWelcomeMessages = new Set();
|
||||
},
|
||||
|
||||
// FIXME: Proper inherittance from ZeppelinPluginBlueprint
|
||||
configParser: (o: any) => o,
|
||||
});
|
||||
|
|
|
@ -8,9 +8,6 @@ import {
|
|||
GuildPluginBlueprint,
|
||||
GuildPluginData,
|
||||
} from "knub";
|
||||
import { PluginOptions } from "knub/dist/config/configTypes";
|
||||
import { Awaitable } from "knub/dist/utils";
|
||||
import { getPluginConfigParser } from "../pluginUtils";
|
||||
import { TMarkdown } from "../types";
|
||||
|
||||
/**
|
||||
|
@ -19,42 +16,30 @@ import { TMarkdown } from "../types";
|
|||
|
||||
export interface ZeppelinGuildPluginBlueprint<TPluginData extends GuildPluginData<any> = GuildPluginData<any>>
|
||||
extends GuildPluginBlueprint<TPluginData> {
|
||||
configSchema: t.TypeC<any>;
|
||||
showInDocs?: boolean;
|
||||
|
||||
info?: {
|
||||
prettyName: string;
|
||||
description?: TMarkdown;
|
||||
usageGuide?: TMarkdown;
|
||||
configurationGuide?: TMarkdown;
|
||||
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>(
|
||||
blueprint: TBlueprint,
|
||||
): TBlueprint & { configParser: ZeppelinGuildPluginBlueprint["configParser"] };
|
||||
export function zeppelinGuildPlugin<TBlueprint extends ZeppelinGuildPluginBlueprint>(blueprint: TBlueprint): TBlueprint;
|
||||
|
||||
export function zeppelinGuildPlugin<TPluginType extends BasePluginType>(): <
|
||||
TBlueprint extends ZeppelinGuildPluginBlueprint<GuildPluginData<TPluginType>>,
|
||||
>(
|
||||
blueprint: TBlueprint,
|
||||
) => TBlueprint & {
|
||||
configParser: ZeppelinGuildPluginBlueprint<GuildPluginData<TPluginType>>["configParser"];
|
||||
};
|
||||
) => TBlueprint;
|
||||
|
||||
export function zeppelinGuildPlugin(...args) {
|
||||
if (args.length) {
|
||||
const blueprint = guildPlugin(
|
||||
...(args as Parameters<typeof guildPlugin>),
|
||||
) as unknown as ZeppelinGuildPluginBlueprint;
|
||||
blueprint.configParser = <any>getPluginConfigParser(blueprint, blueprint.configParser);
|
||||
return blueprint;
|
||||
} else {
|
||||
return zeppelinGuildPlugin as (name, blueprint) => ZeppelinGuildPluginBlueprint;
|
||||
|
@ -66,31 +51,23 @@ export function zeppelinGuildPlugin(...args) {
|
|||
*/
|
||||
|
||||
export interface ZeppelinGlobalPluginBlueprint<TPluginType extends BasePluginType = BasePluginType>
|
||||
extends GlobalPluginBlueprint<GlobalPluginData<TPluginType>> {
|
||||
configSchema: t.TypeC<any>;
|
||||
// FIXME: need proper typings here
|
||||
configParser: (options: TPluginType["config"], strict?: boolean) => Awaitable<PluginOptions<TPluginType>>;
|
||||
}
|
||||
extends GlobalPluginBlueprint<GlobalPluginData<TPluginType>> {}
|
||||
|
||||
export function zeppelinGlobalPlugin<TBlueprint extends ZeppelinGlobalPluginBlueprint>(
|
||||
blueprint: TBlueprint,
|
||||
): TBlueprint & { configParser: ZeppelinGlobalPluginBlueprint["configParser"] };
|
||||
): TBlueprint;
|
||||
|
||||
export function zeppelinGlobalPlugin<TPluginType extends BasePluginType>(): <
|
||||
TBlueprint extends ZeppelinGlobalPluginBlueprint<TPluginType>,
|
||||
>(
|
||||
blueprint: TBlueprint,
|
||||
) => TBlueprint & {
|
||||
configParser: ZeppelinGlobalPluginBlueprint<TPluginType>["configParser"];
|
||||
};
|
||||
) => TBlueprint;
|
||||
|
||||
export function zeppelinGlobalPlugin(...args) {
|
||||
if (args.length) {
|
||||
const blueprint = globalPlugin(
|
||||
...(args as Parameters<typeof globalPlugin>),
|
||||
) as unknown as ZeppelinGlobalPluginBlueprint;
|
||||
// @ts-expect-error FIXME: Check the types here
|
||||
blueprint.configParser = getPluginConfigParser(blueprint, blueprint.configParser);
|
||||
return blueprint;
|
||||
} else {
|
||||
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;
|
||||
|
||||
export function getProfiler() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Awaitable } from "knub/dist/utils";
|
||||
import { Awaitable } from "./typeUtils";
|
||||
|
||||
export async function asyncReduce<T, V>(
|
||||
arr: T[],
|
||||
|
|
|
@ -9,8 +9,8 @@ import {
|
|||
TextBasedChannel,
|
||||
User,
|
||||
} from "discord.js";
|
||||
import { Awaitable } from "knub/dist/utils";
|
||||
import { MINUTES, noop } from "../utils";
|
||||
import { Awaitable } from "./typeUtils";
|
||||
import Timeout = NodeJS.Timeout;
|
||||
|
||||
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 { noop, SECONDS } from "../utils";
|
||||
|
||||
type Profiler = Knub["profiler"];
|
||||
|
||||
let _profilingEnabled = false;
|
||||
|
||||
export const profilingEnabled = () => {
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { getDefaultPrefix } from "knub/dist/commands/commandUtils";
|
||||
import { getDefaultMessageCommandPrefix, GuildPluginData } from "knub";
|
||||
|
||||
export function getGuildPrefix(pluginData: GuildPluginData<any>) {
|
||||
// @ts-expect-error: discord.js version mismatch
|
||||
return pluginData.fullConfig.prefix || getDefaultPrefix(pluginData.client);
|
||||
return pluginData.fullConfig.prefix || getDefaultMessageCommandPrefix(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/
|
||||
export type Awaited<T> = T extends PromiseLike<infer U> ? Awaited<U> : T;
|
||||
|
||||
export type Awaitable<T = unknown> = T | Promise<T>;
|
||||
|
||||
export type DeepMutable<T> = {
|
||||
-readonly [P in keyof T]: DeepMutable<T[P]>;
|
||||
};
|
||||
|
|
|
@ -7,9 +7,9 @@ import {
|
|||
MessageComponentInteraction,
|
||||
MessageCreateOptions,
|
||||
} from "discord.js";
|
||||
import { noop } from "knub/dist/utils";
|
||||
import moment from "moment";
|
||||
import uuidv4 from "uuid/v4";
|
||||
import { noop } from "../utils";
|
||||
|
||||
export async function waitForButtonConfirm(
|
||||
channel: GuildTextBasedChannel,
|
||||
|
@ -37,6 +37,7 @@ export async function waitForButtonConfirm(
|
|||
if (options?.restrictToId && options.restrictToId !== interaction.user.id) {
|
||||
interaction
|
||||
.reply({ content: `You are not permitted to use these buttons.`, ephemeral: true })
|
||||
// tslint:disable-next-line no-console
|
||||
.catch((err) => console.trace(err.message));
|
||||
} else {
|
||||
if (interaction.customId.startsWith(`confirmButton:${idMod}:`)) {
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"moduleResolution": "node",
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "NodeNext",
|
||||
"module": "NodeNext",
|
||||
"noImplicitAny": false,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"experimentalDecorators": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"target": "es2020",
|
||||
"lib": ["esnext"],
|
||||
"target": "es2022",
|
||||
"lib": ["es2022"],
|
||||
"baseUrl": ".",
|
||||
"resolveJsonModule": true,
|
||||
"esModuleInterop": true,
|
||||
|
|
495
package-lock.json
generated
495
package-lock.json
generated
|
@ -7,9 +7,6 @@
|
|||
"": {
|
||||
"name": "@zeppelin/zeppelin",
|
||||
"version": "0.0.1",
|
||||
"dependencies": {
|
||||
"knub": "^30.0.0-beta.39"
|
||||
},
|
||||
"devDependencies": {
|
||||
"husky": "^3.0.9",
|
||||
"lint-staged": "^9.4.2",
|
||||
|
@ -40,48 +37,6 @@
|
|||
"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": {
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz",
|
||||
|
@ -129,26 +84,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": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz",
|
||||
|
@ -175,7 +110,8 @@
|
|||
"node_modules/@types/node": {
|
||||
"version": "12.12.5",
|
||||
"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": {
|
||||
"version": "2.4.0",
|
||||
|
@ -183,14 +119,6 @@
|
|||
"integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==",
|
||||
"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": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz",
|
||||
|
@ -261,11 +189,6 @@
|
|||
"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": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
||||
|
@ -414,17 +337,6 @@
|
|||
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
|
||||
"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": {
|
||||
"version": "2.20.3",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
|
||||
|
@ -509,14 +421,6 @@
|
|||
"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": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz",
|
||||
|
@ -538,55 +442,6 @@
|
|||
"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": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/elegant-spinner/-/elegant-spinner-1.0.1.tgz",
|
||||
|
@ -1065,33 +920,6 @@
|
|||
"integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==",
|
||||
"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": {
|
||||
"version": "1.1.6",
|
||||
"resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz",
|
||||
|
@ -1398,11 +1226,6 @@
|
|||
"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": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz",
|
||||
|
@ -1457,25 +1280,6 @@
|
|||
"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": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
|
||||
|
@ -1528,14 +1332,6 @@
|
|||
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
|
||||
"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": {
|
||||
"version": "2.5.0",
|
||||
"resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz",
|
||||
|
@ -1617,44 +1413,6 @@
|
|||
"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": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
|
||||
|
@ -2171,19 +1929,6 @@
|
|||
"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": {
|
||||
"version": "1.10.0",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz",
|
||||
|
@ -2257,6 +2002,7 @@
|
|||
"version": "4.9.5",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
|
||||
"integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
|
@ -2265,14 +2011,6 @@
|
|||
"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": {
|
||||
"version": "3.0.4",
|
||||
"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",
|
||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
|
||||
"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": {
|
||||
|
@ -2399,40 +2117,6 @@
|
|||
"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": {
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz",
|
||||
|
@ -2468,16 +2152,6 @@
|
|||
"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": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz",
|
||||
|
@ -2504,7 +2178,8 @@
|
|||
"@types/node": {
|
||||
"version": "12.12.5",
|
||||
"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": {
|
||||
"version": "2.4.0",
|
||||
|
@ -2512,14 +2187,6 @@
|
|||
"integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==",
|
||||
"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": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz",
|
||||
|
@ -2572,11 +2239,6 @@
|
|||
"integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==",
|
||||
"dev": true
|
||||
},
|
||||
"asynckit": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
||||
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
||||
},
|
||||
"balanced-match": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
||||
|
@ -2695,14 +2357,6 @@
|
|||
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
|
||||
"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": {
|
||||
"version": "2.20.3",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
|
||||
|
@ -2777,11 +2431,6 @@
|
|||
"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": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz",
|
||||
|
@ -2797,41 +2446,6 @@
|
|||
"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": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/elegant-spinner/-/elegant-spinner-1.0.1.tgz",
|
||||
|
@ -3205,32 +2819,6 @@
|
|||
"integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==",
|
||||
"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": {
|
||||
"version": "1.1.6",
|
||||
"resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz",
|
||||
|
@ -3470,11 +3058,6 @@
|
|||
"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": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz",
|
||||
|
@ -3517,19 +3100,6 @@
|
|||
"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": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
|
||||
|
@ -3574,11 +3144,6 @@
|
|||
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
|
||||
"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": {
|
||||
"version": "2.5.0",
|
||||
"resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz",
|
||||
|
@ -3642,31 +3207,6 @@
|
|||
"integrity": "sha512-pVOEP16TrAO2/fjej1IdOyupJY8KDUM1CvsaScRbw6oddvpQoOfGk4ywha0HKKVAD6RkW4x6Q+tNBwhf3Bgpuw==",
|
||||
"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": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
|
||||
|
@ -4053,17 +3593,6 @@
|
|||
"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": {
|
||||
"version": "1.10.0",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz",
|
||||
|
@ -4115,12 +3644,8 @@
|
|||
"typescript": {
|
||||
"version": "4.9.5",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
|
||||
"integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g=="
|
||||
},
|
||||
"vali-date": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz",
|
||||
"integrity": "sha1-G5BKWWCfsyjvB4E4Qgk09rhnCaY="
|
||||
"integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
|
||||
"dev": true
|
||||
},
|
||||
"validate-npm-package-license": {
|
||||
"version": "3.0.4",
|
||||
|
@ -4189,12 +3714,6 @@
|
|||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
|
||||
"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",
|
||||
"git add"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"knub": "^30.0.0-beta.39"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"moduleResolution": "node",
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "NodeNext",
|
||||
"module": "NodeNext",
|
||||
"noImplicitAny": false,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"experimentalDecorators": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"target": "es2018",
|
||||
"lib": ["esnext"],
|
||||
"target": "es2022",
|
||||
"lib": ["es2022"],
|
||||
"baseUrl": "src",
|
||||
"resolveJsonModule": true,
|
||||
"esModuleInterop": true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue