feat: update knub; use base Knub types for plugins
This commit is contained in:
parent
4597b83cda
commit
c2ae6d53d8
90 changed files with 713 additions and 607 deletions
|
@ -5,27 +5,27 @@
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"watch": "NODE_ENV=development HOST_MODE=development tsc-watch --onSuccess \"node start-dev.js\"",
|
"watch": "NODE_ENV=development HOST_MODE=development tsc-watch --onSuccess \"node start-dev.js\"",
|
||||||
"watch-yaml-parse-test": "NODE_ENV=development HOST_MODE=development tsc-watch --onSuccess \"node dist/backend/src/yamlParseTest.js\"",
|
"watch-yaml-parse-test": "NODE_ENV=development HOST_MODE=development tsc-watch --onSuccess \"node dist/yamlParseTest.js\"",
|
||||||
"build": "tsc --build",
|
"build": "tsc --build",
|
||||||
"start-bot-dev": "NODE_ENV=development HOST_MODE=development node --enable-source-maps --stack-trace-limit=30 --inspect=0.0.0.0:9229 dist/backend/src/index.js",
|
"start-bot-dev": "NODE_ENV=development HOST_MODE=development node --enable-source-maps --stack-trace-limit=30 --inspect=0.0.0.0:9229 dist/index.js",
|
||||||
"start-bot-dev-debug": "NODE_ENV=development DEBUG=true clinic heapprofiler --collect-only --dest .clinic-bot -- node --enable-source-maps --stack-trace-limit=30 --inspect=0.0.0.0:9229 dist/backend/src/index.js",
|
"start-bot-dev-debug": "NODE_ENV=development DEBUG=true clinic heapprofiler --collect-only --dest .clinic-bot -- node --enable-source-maps --stack-trace-limit=30 --inspect=0.0.0.0:9229 dist/index.js",
|
||||||
"start-bot-prod": "cross-env NODE_ENV=production node --enable-source-maps --stack-trace-limit=30 dist/backend/src/index.js",
|
"start-bot-prod": "cross-env NODE_ENV=production node --enable-source-maps --stack-trace-limit=30 dist/index.js",
|
||||||
"start-bot-prod-debug": "NODE_ENV=production DEBUG=true clinic heapprofiler --collect-only --dest .clinic-bot -- node --enable-source-maps --stack-trace-limit=30 dist/backend/src/index.js",
|
"start-bot-prod-debug": "NODE_ENV=production DEBUG=true clinic heapprofiler --collect-only --dest .clinic-bot -- node --enable-source-maps --stack-trace-limit=30 dist/index.js",
|
||||||
"watch-bot": "NODE_ENV=development HOST_MODE=development tsc-watch --onSuccess \"npm run start-bot-dev\"",
|
"watch-bot": "NODE_ENV=development HOST_MODE=development tsc-watch --onSuccess \"npm run start-bot-dev\"",
|
||||||
"start-api-dev": "NODE_ENV=development HOST_MODE=development node --enable-source-maps --stack-trace-limit=30 --inspect=0.0.0.0:9239 dist/backend/src/api/index.js",
|
"start-api-dev": "NODE_ENV=development HOST_MODE=development node --enable-source-maps --stack-trace-limit=30 --inspect=0.0.0.0:9239 dist/api/index.js",
|
||||||
"start-api-dev-debug": "NODE_ENV=development DEBUG=true clinic heapprofiler --collect-only --dest .clinic-api -- node --enable-source-maps --stack-trace-limit=30 --inspect=0.0.0.0:9239 dist/backend/src/api/index.js",
|
"start-api-dev-debug": "NODE_ENV=development DEBUG=true clinic heapprofiler --collect-only --dest .clinic-api -- node --enable-source-maps --stack-trace-limit=30 --inspect=0.0.0.0:9239 dist/api/index.js",
|
||||||
"start-api-prod": "cross-env NODE_ENV=production node --enable-source-maps --stack-trace-limit=30 dist/backend/src/api/index.js",
|
"start-api-prod": "cross-env NODE_ENV=production node --enable-source-maps --stack-trace-limit=30 dist/api/index.js",
|
||||||
"start-api-prod-debug": "NODE_ENV=production DEBUG=true clinic heapprofiler --collect-only --dest .clinic-api -- node --enable-source-maps --stack-trace-limit=30 dist/backend/src/api/index.js",
|
"start-api-prod-debug": "NODE_ENV=production DEBUG=true clinic heapprofiler --collect-only --dest .clinic-api -- node --enable-source-maps --stack-trace-limit=30 dist/api/index.js",
|
||||||
"watch-api": "NODE_ENV=development HOST_MODE=development tsc-watch --onSuccess \"npm run start-api-dev\"",
|
"watch-api": "NODE_ENV=development HOST_MODE=development tsc-watch --onSuccess \"npm run start-api-dev\"",
|
||||||
"typeorm": "node ./node_modules/typeorm/cli.js",
|
"typeorm": "node ./node_modules/typeorm/cli.js",
|
||||||
"migrate": "npm run typeorm -- migration:run -d dist/backend/src/data/dataSource.js",
|
"migrate": "npm run typeorm -- migration:run -d dist/data/dataSource.js",
|
||||||
"migrate-prod": "cross-env NODE_ENV=production npm run migrate",
|
"migrate-prod": "cross-env NODE_ENV=production npm run migrate",
|
||||||
"migrate-dev": "NODE_ENV=development HOST_MODE=development npm run build && npm run migrate",
|
"migrate-dev": "NODE_ENV=development HOST_MODE=development npm run build && npm run migrate",
|
||||||
"migrate-rollback": "npm run typeorm -- migration:revert -d dist/backend/src/data/dataSource.js",
|
"migrate-rollback": "npm run typeorm -- migration:revert -d dist/data/dataSource.js",
|
||||||
"migrate-rollback-prod": "cross-env NODE_ENV=production npm run migrate",
|
"migrate-rollback-prod": "cross-env NODE_ENV=production npm run migrate",
|
||||||
"migrate-rollback-dev": "NODE_ENV=development HOST_MODE=development npm run build && npm run migrate",
|
"migrate-rollback-dev": "NODE_ENV=development HOST_MODE=development npm run build && npm run migrate",
|
||||||
"validate-active-configs": "NODE_ENV=development HOST_MODE=development node --enable-source-maps dist/backend/src/validateActiveConfigs.js > ../config-errors.txt",
|
"validate-active-configs": "NODE_ENV=development HOST_MODE=development node --enable-source-maps dist/validateActiveConfigs.js > ../config-errors.txt",
|
||||||
"export-config-json-schema": "NODE_ENV=development HOST_MODE=development node --enable-source-maps dist/backend/src/exportSchemas.js > ../config-schema.json",
|
"export-config-json-schema": "NODE_ENV=development HOST_MODE=development node --enable-source-maps dist/exportSchemas.js > ../config-schema.json",
|
||||||
"test": "npm run build && npm run run-tests",
|
"test": "npm run build && npm run run-tests",
|
||||||
"run-tests": "ava",
|
"run-tests": "ava",
|
||||||
"test-watch": "tsc-watch --onSuccess \"npx ava\""
|
"test-watch": "tsc-watch --onSuccess \"npx ava\""
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
"fp-ts": "^2.0.1",
|
"fp-ts": "^2.0.1",
|
||||||
"humanize-duration": "^3.15.0",
|
"humanize-duration": "^3.15.0",
|
||||||
"js-yaml": "^3.13.1",
|
"js-yaml": "^3.13.1",
|
||||||
"knub": "^32.0.0-next.18",
|
"knub": "^32.0.0-next.20",
|
||||||
"knub-command-manager": "^9.1.0",
|
"knub-command-manager": "^9.1.0",
|
||||||
"last-commit-log": "^2.1.0",
|
"last-commit-log": "^2.1.0",
|
||||||
"lodash.chunk": "^4.2.0",
|
"lodash.chunk": "^4.2.0",
|
||||||
|
@ -102,7 +102,7 @@
|
||||||
},
|
},
|
||||||
"ava": {
|
"ava": {
|
||||||
"files": [
|
"files": [
|
||||||
"dist/backend/src/**/*.test.js"
|
"dist/**/*.test.js"
|
||||||
],
|
],
|
||||||
"require": [
|
"require": [
|
||||||
"./register-tsconfig-paths.js"
|
"./register-tsconfig-paths.js"
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import express from "express";
|
import express from "express";
|
||||||
import z from "zod";
|
import z from "zod";
|
||||||
import { guildPlugins } from "../plugins/availablePlugins";
|
import { guildPlugins } from "../plugins/availablePlugins";
|
||||||
|
import { guildPluginInfo } from "../plugins/pluginInfo";
|
||||||
import { indentLines } from "../utils";
|
import { indentLines } from "../utils";
|
||||||
import { notFound } from "./responses";
|
import { notFound } from "./responses";
|
||||||
|
|
||||||
|
@ -97,14 +98,15 @@ function formatZodConfigSchema(schema: z.ZodTypeAny) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function initDocs(app: express.Express) {
|
export function initDocs(app: express.Express) {
|
||||||
const docsPlugins = guildPlugins.filter((plugin) => plugin.showInDocs);
|
const docsPluginNames = Object.keys(guildPluginInfo).filter((k) => guildPluginInfo[k].showInDocs);
|
||||||
|
|
||||||
app.get("/docs/plugins", (req: express.Request, res: express.Response) => {
|
app.get("/docs/plugins", (req: express.Request, res: express.Response) => {
|
||||||
res.json(
|
res.json(
|
||||||
docsPlugins.map((plugin) => {
|
docsPluginNames.map((pluginName) => {
|
||||||
const thinInfo = plugin.info ? { prettyName: plugin.info.prettyName, legacy: plugin.info.legacy ?? false } : {};
|
const info = guildPluginInfo[pluginName];
|
||||||
|
const thinInfo = info ? { prettyName: info.prettyName, legacy: info.legacy ?? false } : {};
|
||||||
return {
|
return {
|
||||||
name: plugin.name,
|
name: pluginName,
|
||||||
info: thinInfo,
|
info: thinInfo,
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
|
@ -112,14 +114,14 @@ export function initDocs(app: express.Express) {
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get("/docs/plugins/:pluginName", (req: express.Request, res: express.Response) => {
|
app.get("/docs/plugins/:pluginName", (req: express.Request, res: express.Response) => {
|
||||||
// prettier-ignore
|
const name = req.params.pluginName;
|
||||||
const plugin = docsPlugins.find(_plugin => _plugin.name === req.params.pluginName);
|
const baseInfo = guildPluginInfo[name];
|
||||||
if (!plugin) {
|
if (!baseInfo) {
|
||||||
return notFound(res);
|
return notFound(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
const name = plugin.name;
|
const plugin = guildPlugins.find((p) => p.name === name)!;
|
||||||
const info = { ...(plugin.info || {}) };
|
const info = { ...baseInfo };
|
||||||
delete info.configSchema;
|
delete info.configSchema;
|
||||||
|
|
||||||
const messageCommands = (plugin.messageCommands || []).map((cmd) => ({
|
const messageCommands = (plugin.messageCommands || []).map((cmd) => ({
|
||||||
|
@ -132,7 +134,7 @@ export function initDocs(app: express.Express) {
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const defaultOptions = plugin.defaultOptions || {};
|
const defaultOptions = plugin.defaultOptions || {};
|
||||||
const configSchema = plugin.info?.configSchema && formatZodConfigSchema(plugin.info.configSchema);
|
const configSchema = info.configSchema && formatZodConfigSchema(info.configSchema);
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
name,
|
name,
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
import { ConfigValidationError, PluginConfigManager } from "knub";
|
import { ConfigValidationError, GuildPluginBlueprint, PluginConfigManager } from "knub";
|
||||||
import moment from "moment-timezone";
|
import moment from "moment-timezone";
|
||||||
import { ZodError } from "zod";
|
import { ZodError } from "zod";
|
||||||
import { ZeppelinPlugin } from "./plugins/ZeppelinPlugin";
|
|
||||||
import { guildPlugins } from "./plugins/availablePlugins";
|
import { guildPlugins } from "./plugins/availablePlugins";
|
||||||
import { ZeppelinGuildConfig, zZeppelinGuildConfig } from "./types";
|
import { ZeppelinGuildConfig, zZeppelinGuildConfig } from "./types";
|
||||||
import { formatZodIssue } from "./utils/formatZodIssue";
|
import { formatZodIssue } from "./utils/formatZodIssue";
|
||||||
|
|
||||||
const pluginNameToPlugin = new Map<string, ZeppelinPlugin>();
|
const pluginNameToPlugin = new Map<string, GuildPluginBlueprint<any, any>>();
|
||||||
for (const plugin of guildPlugins) {
|
for (const plugin of guildPlugins) {
|
||||||
pluginNameToPlugin.set(plugin.name, plugin);
|
pluginNameToPlugin.set(plugin.name, plugin);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,8 +7,8 @@ import { backendDir } from "../paths";
|
||||||
|
|
||||||
moment.tz.setDefault("UTC");
|
moment.tz.setDefault("UTC");
|
||||||
|
|
||||||
const entities = path.relative(process.cwd(), path.resolve(backendDir, "dist/backend/src/data/entities/*.js"));
|
const entities = path.relative(process.cwd(), path.resolve(backendDir, "dist/data/entities/*.js"));
|
||||||
const migrations = path.relative(process.cwd(), path.resolve(backendDir, "dist/backend/src/migrations/*.js"));
|
const migrations = path.relative(process.cwd(), path.resolve(backendDir, "dist/migrations/*.js"));
|
||||||
|
|
||||||
type DbOpts = Pick<MysqlConnectionOptions, "host" | "port" | "username" | "password" | "database">;
|
type DbOpts = Pick<MysqlConnectionOptions, "host" | "port" | "username" | "password" | "database">;
|
||||||
let dbOpts: DbOpts;
|
let dbOpts: DbOpts;
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import zodToJsonSchema from "zod-to-json-schema";
|
import zodToJsonSchema from "zod-to-json-schema";
|
||||||
import { guildPlugins } from "./plugins/availablePlugins";
|
import { guildPluginInfo } from "./plugins/pluginInfo";
|
||||||
import { zZeppelinGuildConfig } from "./types";
|
import { zZeppelinGuildConfig } from "./types";
|
||||||
|
|
||||||
const pluginSchemaMap = guildPlugins.reduce((map, plugin) => {
|
const pluginSchemaMap = Object.entries(guildPluginInfo).reduce((map, [pluginName, pluginInfo]) => {
|
||||||
if (!plugin.info) {
|
if (pluginInfo.configSchema) {
|
||||||
return map;
|
map[pluginName] = pluginInfo.configSchema;
|
||||||
}
|
}
|
||||||
map[plugin.name] = plugin.info.configSchema;
|
|
||||||
return map;
|
return map;
|
||||||
}, {});
|
}, {});
|
||||||
|
|
||||||
|
|
|
@ -445,7 +445,7 @@ connect().then(async () => {
|
||||||
logger.info("Cleaning up before exit...");
|
logger.info("Cleaning up before exit...");
|
||||||
// Force exit after 10sec
|
// Force exit after 10sec
|
||||||
setTimeout(() => process.exit(code), 10 * SECONDS);
|
setTimeout(() => process.exit(code), 10 * SECONDS);
|
||||||
await bot.stop();
|
await bot.destroy();
|
||||||
await dataSource.destroy();
|
await dataSource.destroy();
|
||||||
logger.info("Done! Exiting now.");
|
logger.info("Done! Exiting now.");
|
||||||
process.exit(code);
|
process.exit(code);
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions, guildPlugin } from "knub";
|
||||||
import { GuildLogs } from "../../data/GuildLogs";
|
import { GuildLogs } from "../../data/GuildLogs";
|
||||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||||
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { AutoDeletePluginType, zAutoDeleteConfig } from "./types";
|
import { AutoDeletePluginType, zAutoDeleteConfig } from "./types";
|
||||||
import { onMessageCreate } from "./util/onMessageCreate";
|
import { onMessageCreate } from "./util/onMessageCreate";
|
||||||
import { onMessageDelete } from "./util/onMessageDelete";
|
import { onMessageDelete } from "./util/onMessageDelete";
|
||||||
|
@ -16,15 +15,8 @@ const defaultOptions: PluginOptions<AutoDeletePluginType> = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const AutoDeletePlugin = zeppelinGuildPlugin<AutoDeletePluginType>()({
|
export const AutoDeletePlugin = guildPlugin<AutoDeletePluginType>()({
|
||||||
name: "auto_delete",
|
name: "auto_delete",
|
||||||
showInDocs: true,
|
|
||||||
info: {
|
|
||||||
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: zAutoDeleteConfig,
|
|
||||||
} as any,
|
|
||||||
|
|
||||||
dependencies: () => [TimeAndDatePlugin, LogsPlugin],
|
dependencies: () => [TimeAndDatePlugin, LogsPlugin],
|
||||||
configParser: (input) => zAutoDeleteConfig.parse(input),
|
configParser: (input) => zAutoDeleteConfig.parse(input),
|
||||||
|
|
8
backend/src/plugins/AutoDelete/info.ts
Normal file
8
backend/src/plugins/AutoDelete/info.ts
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../../types";
|
||||||
|
|
||||||
|
export const autoDeletePluginInfo: ZeppelinPluginInfo = {
|
||||||
|
showInDocs: true,
|
||||||
|
prettyName: "Auto-delete",
|
||||||
|
description: "Allows Zeppelin to auto-delete messages from a channel after a delay",
|
||||||
|
configurationGuide: "Maximum deletion delay is currently 5 minutes",
|
||||||
|
};
|
|
@ -1,9 +1,7 @@
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions, guildPlugin } from "knub";
|
||||||
import { GuildAutoReactions } from "../../data/GuildAutoReactions";
|
import { GuildAutoReactions } from "../../data/GuildAutoReactions";
|
||||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||||
import { trimPluginDescription } from "../../utils";
|
|
||||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { DisableAutoReactionsCmd } from "./commands/DisableAutoReactionsCmd";
|
import { DisableAutoReactionsCmd } from "./commands/DisableAutoReactionsCmd";
|
||||||
import { NewAutoReactionsCmd } from "./commands/NewAutoReactionsCmd";
|
import { NewAutoReactionsCmd } from "./commands/NewAutoReactionsCmd";
|
||||||
import { AddReactionsEvt } from "./events/AddReactionsEvt";
|
import { AddReactionsEvt } from "./events/AddReactionsEvt";
|
||||||
|
@ -23,16 +21,8 @@ const defaultOptions: PluginOptions<AutoReactionsPluginType> = {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const AutoReactionsPlugin = zeppelinGuildPlugin<AutoReactionsPluginType>()({
|
export const AutoReactionsPlugin = guildPlugin<AutoReactionsPluginType>()({
|
||||||
name: "auto_reactions",
|
name: "auto_reactions",
|
||||||
showInDocs: true,
|
|
||||||
info: {
|
|
||||||
prettyName: "Auto-reactions",
|
|
||||||
description: trimPluginDescription(`
|
|
||||||
Allows setting up automatic reactions to all new messages on a channel
|
|
||||||
`),
|
|
||||||
configSchema: zAutoReactionsConfig,
|
|
||||||
},
|
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
dependencies: () => [
|
dependencies: () => [
|
||||||
|
|
10
backend/src/plugins/AutoReactions/info.ts
Normal file
10
backend/src/plugins/AutoReactions/info.ts
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../../types";
|
||||||
|
import { trimPluginDescription } from "../../utils";
|
||||||
|
|
||||||
|
export const autoReactionsInfo: ZeppelinPluginInfo = {
|
||||||
|
showInDocs: true,
|
||||||
|
prettyName: "Auto-reactions",
|
||||||
|
description: trimPluginDescription(`
|
||||||
|
Allows setting up automatic reactions to all new messages on a channel
|
||||||
|
`),
|
||||||
|
};
|
|
@ -1,4 +1,4 @@
|
||||||
import { CooldownManager } from "knub";
|
import { CooldownManager, guildPlugin } from "knub";
|
||||||
import { Queue } from "../../Queue";
|
import { Queue } from "../../Queue";
|
||||||
import { GuildAntiraidLevels } from "../../data/GuildAntiraidLevels";
|
import { GuildAntiraidLevels } from "../../data/GuildAntiraidLevels";
|
||||||
import { GuildArchives } from "../../data/GuildArchives";
|
import { GuildArchives } from "../../data/GuildArchives";
|
||||||
|
@ -15,7 +15,6 @@ import { ModActionsPlugin } from "../ModActions/ModActionsPlugin";
|
||||||
import { MutesPlugin } from "../Mutes/MutesPlugin";
|
import { MutesPlugin } from "../Mutes/MutesPlugin";
|
||||||
import { PhishermanPlugin } from "../Phisherman/PhishermanPlugin";
|
import { PhishermanPlugin } from "../Phisherman/PhishermanPlugin";
|
||||||
import { RoleManagerPlugin } from "../RoleManager/RoleManagerPlugin";
|
import { RoleManagerPlugin } from "../RoleManager/RoleManagerPlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { AntiraidClearCmd } from "./commands/AntiraidClearCmd";
|
import { AntiraidClearCmd } from "./commands/AntiraidClearCmd";
|
||||||
import { SetAntiraidCmd } from "./commands/SetAntiraidCmd";
|
import { SetAntiraidCmd } from "./commands/SetAntiraidCmd";
|
||||||
import { ViewAntiraidCmd } from "./commands/ViewAntiraidCmd";
|
import { ViewAntiraidCmd } from "./commands/ViewAntiraidCmd";
|
||||||
|
@ -32,7 +31,6 @@ import {
|
||||||
import { clearOldRecentNicknameChanges } from "./functions/clearOldNicknameChanges";
|
import { clearOldRecentNicknameChanges } from "./functions/clearOldNicknameChanges";
|
||||||
import { clearOldRecentActions } from "./functions/clearOldRecentActions";
|
import { clearOldRecentActions } from "./functions/clearOldRecentActions";
|
||||||
import { clearOldRecentSpam } from "./functions/clearOldRecentSpam";
|
import { clearOldRecentSpam } from "./functions/clearOldRecentSpam";
|
||||||
import { pluginInfo } from "./info";
|
|
||||||
import { AutomodPluginType, zAutomodConfig } from "./types";
|
import { AutomodPluginType, zAutomodConfig } from "./types";
|
||||||
|
|
||||||
const defaultOptions = {
|
const defaultOptions = {
|
||||||
|
@ -58,10 +56,8 @@ const defaultOptions = {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const AutomodPlugin = zeppelinGuildPlugin<AutomodPluginType>()({
|
export const AutomodPlugin = guildPlugin<AutomodPluginType>()({
|
||||||
name: "automod",
|
name: "automod",
|
||||||
showInDocs: true,
|
|
||||||
info: pluginInfo,
|
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
dependencies: () => [
|
dependencies: () => [
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../../types";
|
||||||
import { trimPluginDescription } from "../../utils";
|
import { trimPluginDescription } from "../../utils";
|
||||||
import { ZeppelinGuildPluginBlueprint } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { zAutomodConfig } from "./types";
|
|
||||||
|
|
||||||
export const pluginInfo: ZeppelinGuildPluginBlueprint["info"] = {
|
export const automodPluginInfo: ZeppelinPluginInfo = {
|
||||||
|
showInDocs: true,
|
||||||
prettyName: "Automod",
|
prettyName: "Automod",
|
||||||
description: trimPluginDescription(`
|
description: trimPluginDescription(`
|
||||||
Allows specifying automated actions in response to triggers. Example use cases include word filtering and spam prevention.
|
Allows specifying automated actions in response to triggers. Example use cases include word filtering and spam prevention.
|
||||||
`),
|
`),
|
||||||
configurationGuide: trimPluginDescription(`
|
configurationGuide: trimPluginDescription(`
|
||||||
The automod plugin is very customizable. For a full list of available triggers, actions, and their options, see Config schema at the bottom of this page.
|
The automod plugin is very customizable. For a full list of available triggers, actions, and their options, see Config schema at the bottom of this page.
|
||||||
|
|
||||||
|
@ -99,6 +99,5 @@ export const pluginInfo: ZeppelinGuildPluginBlueprint["info"] = {
|
||||||
Bad custom status on user <@!{user.id}>:
|
Bad custom status on user <@!{user.id}>:
|
||||||
{matchSummary}
|
{matchSummary}
|
||||||
~~~
|
~~~
|
||||||
`),
|
`),
|
||||||
configSchema: zAutomodConfig,
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { Snowflake, TextChannel } from "discord.js";
|
import { Snowflake, TextChannel } from "discord.js";
|
||||||
|
import { globalPlugin } from "knub";
|
||||||
import { AllowedGuilds } from "../../data/AllowedGuilds";
|
import { AllowedGuilds } from "../../data/AllowedGuilds";
|
||||||
import { ApiPermissionAssignments } from "../../data/ApiPermissionAssignments";
|
import { ApiPermissionAssignments } from "../../data/ApiPermissionAssignments";
|
||||||
import { Configs } from "../../data/Configs";
|
import { Configs } from "../../data/Configs";
|
||||||
import { GuildArchives } from "../../data/GuildArchives";
|
import { GuildArchives } from "../../data/GuildArchives";
|
||||||
import { sendSuccessMessage } from "../../pluginUtils";
|
import { sendSuccessMessage } from "../../pluginUtils";
|
||||||
import { zeppelinGlobalPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { getActiveReload, resetActiveReload } from "./activeReload";
|
import { getActiveReload, resetActiveReload } from "./activeReload";
|
||||||
import { AddDashboardUserCmd } from "./commands/AddDashboardUserCmd";
|
import { AddDashboardUserCmd } from "./commands/AddDashboardUserCmd";
|
||||||
import { AddServerFromInviteCmd } from "./commands/AddServerFromInviteCmd";
|
import { AddServerFromInviteCmd } from "./commands/AddServerFromInviteCmd";
|
||||||
|
@ -35,7 +35,7 @@ const defaultOptions = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const BotControlPlugin = zeppelinGlobalPlugin<BotControlPluginType>()({
|
export const BotControlPlugin = globalPlugin<BotControlPluginType>()({
|
||||||
name: "bot_control",
|
name: "bot_control",
|
||||||
configParser: (input) => zBotControlConfig.parse(input),
|
configParser: (input) => zBotControlConfig.parse(input),
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
|
import { guildPlugin } from "knub";
|
||||||
import { CaseTypes } from "../../data/CaseTypes";
|
import { CaseTypes } from "../../data/CaseTypes";
|
||||||
import { Case } from "../../data/entities/Case";
|
|
||||||
import { GuildArchives } from "../../data/GuildArchives";
|
import { GuildArchives } from "../../data/GuildArchives";
|
||||||
import { GuildCases } from "../../data/GuildCases";
|
import { GuildCases } from "../../data/GuildCases";
|
||||||
import { GuildLogs } from "../../data/GuildLogs";
|
import { GuildLogs } from "../../data/GuildLogs";
|
||||||
|
import { Case } from "../../data/entities/Case";
|
||||||
import { mapToPublicFn } from "../../pluginUtils";
|
import { mapToPublicFn } from "../../pluginUtils";
|
||||||
import { trimPluginDescription } from "../../utils";
|
|
||||||
import { InternalPosterPlugin } from "../InternalPoster/InternalPosterPlugin";
|
import { InternalPosterPlugin } from "../InternalPoster/InternalPosterPlugin";
|
||||||
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { createCase } from "./functions/createCase";
|
import { createCase } from "./functions/createCase";
|
||||||
import { createCaseNote } from "./functions/createCaseNote";
|
import { createCaseNote } from "./functions/createCaseNote";
|
||||||
import { getCaseEmbed } from "./functions/getCaseEmbed";
|
import { getCaseEmbed } from "./functions/getCaseEmbed";
|
||||||
|
@ -34,16 +33,8 @@ const defaultOptions = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const CasesPlugin = zeppelinGuildPlugin<CasesPluginType>()({
|
export const CasesPlugin = guildPlugin<CasesPluginType>()({
|
||||||
name: "cases",
|
name: "cases",
|
||||||
showInDocs: true,
|
|
||||||
info: {
|
|
||||||
prettyName: "Cases",
|
|
||||||
description: trimPluginDescription(`
|
|
||||||
This plugin contains basic configuration for cases created by other plugins
|
|
||||||
`),
|
|
||||||
configSchema: zCasesConfig,
|
|
||||||
},
|
|
||||||
|
|
||||||
dependencies: async () => [TimeAndDatePlugin, InternalPosterPlugin, (await getLogsPlugin()).LogsPlugin],
|
dependencies: async () => [TimeAndDatePlugin, InternalPosterPlugin, (await getLogsPlugin()).LogsPlugin],
|
||||||
configParser: (input) => zCasesConfig.parse(input),
|
configParser: (input) => zCasesConfig.parse(input),
|
||||||
|
|
10
backend/src/plugins/Cases/info.ts
Normal file
10
backend/src/plugins/Cases/info.ts
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../../types";
|
||||||
|
import { trimPluginDescription } from "../../utils";
|
||||||
|
|
||||||
|
export const casesPluginInfo: ZeppelinPluginInfo = {
|
||||||
|
showInDocs: true,
|
||||||
|
prettyName: "Cases",
|
||||||
|
description: trimPluginDescription(`
|
||||||
|
This plugin contains basic configuration for cases created by other plugins
|
||||||
|
`),
|
||||||
|
};
|
|
@ -1,10 +1,8 @@
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions, guildPlugin } from "knub";
|
||||||
import { GuildLogs } from "../../data/GuildLogs";
|
import { GuildLogs } from "../../data/GuildLogs";
|
||||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||||
import { discardRegExpRunner, getRegExpRunner } from "../../regExpRunners";
|
import { discardRegExpRunner, getRegExpRunner } from "../../regExpRunners";
|
||||||
import { trimPluginDescription } from "../../utils";
|
|
||||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { CensorPluginType, zCensorConfig } from "./types";
|
import { CensorPluginType, zCensorConfig } from "./types";
|
||||||
import { onMessageCreate } from "./util/onMessageCreate";
|
import { onMessageCreate } from "./util/onMessageCreate";
|
||||||
import { onMessageUpdate } from "./util/onMessageUpdate";
|
import { onMessageUpdate } from "./util/onMessageUpdate";
|
||||||
|
@ -43,18 +41,8 @@ const defaultOptions: PluginOptions<CensorPluginType> = {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const CensorPlugin = zeppelinGuildPlugin<CensorPluginType>()({
|
export const CensorPlugin = guildPlugin<CensorPluginType>()({
|
||||||
name: "censor",
|
name: "censor",
|
||||||
showInDocs: true,
|
|
||||||
info: {
|
|
||||||
prettyName: "Censor",
|
|
||||||
description: trimPluginDescription(`
|
|
||||||
Censor words, tokens, links, regex, etc.
|
|
||||||
For more advanced filtering, check out the Automod plugin!
|
|
||||||
`),
|
|
||||||
legacy: true,
|
|
||||||
configSchema: zCensorConfig,
|
|
||||||
},
|
|
||||||
|
|
||||||
dependencies: () => [LogsPlugin],
|
dependencies: () => [LogsPlugin],
|
||||||
configParser: (input) => zCensorConfig.parse(input),
|
configParser: (input) => zCensorConfig.parse(input),
|
||||||
|
|
12
backend/src/plugins/Censor/info.ts
Normal file
12
backend/src/plugins/Censor/info.ts
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../../types";
|
||||||
|
import { trimPluginDescription } from "../../utils";
|
||||||
|
|
||||||
|
export const censorPluginInfo: ZeppelinPluginInfo = {
|
||||||
|
showInDocs: true,
|
||||||
|
legacy: true,
|
||||||
|
prettyName: "Censor",
|
||||||
|
description: trimPluginDescription(`
|
||||||
|
Censor words, tokens, links, regex, etc.
|
||||||
|
For more advanced filtering, check out the Automod plugin!
|
||||||
|
`),
|
||||||
|
};
|
|
@ -1,12 +1,11 @@
|
||||||
|
import { guildPlugin } from "knub";
|
||||||
import z from "zod";
|
import z from "zod";
|
||||||
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { ArchiveChannelCmd } from "./commands/ArchiveChannelCmd";
|
import { ArchiveChannelCmd } from "./commands/ArchiveChannelCmd";
|
||||||
import { ChannelArchiverPluginType } from "./types";
|
import { ChannelArchiverPluginType } from "./types";
|
||||||
|
|
||||||
export const ChannelArchiverPlugin = zeppelinGuildPlugin<ChannelArchiverPluginType>()({
|
export const ChannelArchiverPlugin = guildPlugin<ChannelArchiverPluginType>()({
|
||||||
name: "channel_archiver",
|
name: "channel_archiver",
|
||||||
showInDocs: false,
|
|
||||||
|
|
||||||
dependencies: () => [TimeAndDatePlugin],
|
dependencies: () => [TimeAndDatePlugin],
|
||||||
configParser: (input) => z.strictObject({}).parse(input),
|
configParser: (input) => z.strictObject({}).parse(input),
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
import { CooldownManager } from "knub";
|
import { CooldownManager, guildPlugin } from "knub";
|
||||||
import { GuildLogs } from "../../data/GuildLogs";
|
import { GuildLogs } from "../../data/GuildLogs";
|
||||||
import { trimPluginDescription } from "../../utils";
|
|
||||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { VoiceStateUpdateEvt } from "./events/VoiceStateUpdateEvt";
|
import { VoiceStateUpdateEvt } from "./events/VoiceStateUpdateEvt";
|
||||||
import { CompanionChannelsPluginType, zCompanionChannelsConfig } from "./types";
|
import { CompanionChannelsPluginType, zCompanionChannelsConfig } from "./types";
|
||||||
|
|
||||||
|
@ -12,18 +10,8 @@ const defaultOptions = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const CompanionChannelsPlugin = zeppelinGuildPlugin<CompanionChannelsPluginType>()({
|
export const CompanionChannelsPlugin = guildPlugin<CompanionChannelsPluginType>()({
|
||||||
name: "companion_channels",
|
name: "companion_channels",
|
||||||
showInDocs: true,
|
|
||||||
info: {
|
|
||||||
prettyName: "Companion channels",
|
|
||||||
description: trimPluginDescription(`
|
|
||||||
Set up 'companion channels' between text and voice channels.
|
|
||||||
Once set up, any time a user joins one of the specified voice channels,
|
|
||||||
they'll get channel permissions applied to them for the text channels.
|
|
||||||
`),
|
|
||||||
configSchema: zCompanionChannelsConfig,
|
|
||||||
},
|
|
||||||
|
|
||||||
dependencies: () => [LogsPlugin],
|
dependencies: () => [LogsPlugin],
|
||||||
configParser: (input) => zCompanionChannelsConfig.parse(input),
|
configParser: (input) => zCompanionChannelsConfig.parse(input),
|
||||||
|
|
12
backend/src/plugins/CompanionChannels/info.ts
Normal file
12
backend/src/plugins/CompanionChannels/info.ts
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../../types";
|
||||||
|
import { trimPluginDescription } from "../../utils";
|
||||||
|
|
||||||
|
export const companionChannelsPluginInfo: ZeppelinPluginInfo = {
|
||||||
|
showInDocs: true,
|
||||||
|
prettyName: "Companion channels",
|
||||||
|
description: trimPluginDescription(`
|
||||||
|
Set up 'companion channels' between text and voice channels.
|
||||||
|
Once set up, any time a user joins one of the specified voice channels,
|
||||||
|
they'll get channel permissions applied to them for the text channels.
|
||||||
|
`),
|
||||||
|
};
|
|
@ -1,9 +1,8 @@
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions, guildPlugin } from "knub";
|
||||||
import { GuildContextMenuLinks } from "../../data/GuildContextMenuLinks";
|
import { GuildContextMenuLinks } from "../../data/GuildContextMenuLinks";
|
||||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||||
import { MutesPlugin } from "../Mutes/MutesPlugin";
|
import { MutesPlugin } from "../Mutes/MutesPlugin";
|
||||||
import { UtilityPlugin } from "../Utility/UtilityPlugin";
|
import { UtilityPlugin } from "../Utility/UtilityPlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { ContextClickedEvt } from "./events/ContextClickedEvt";
|
import { ContextClickedEvt } from "./events/ContextClickedEvt";
|
||||||
import { ContextMenuPluginType, zContextMenusConfig } from "./types";
|
import { ContextMenuPluginType, zContextMenusConfig } from "./types";
|
||||||
import { loadAllCommands } from "./utils/loadAllCommands";
|
import { loadAllCommands } from "./utils/loadAllCommands";
|
||||||
|
@ -31,9 +30,8 @@ const defaultOptions: PluginOptions<ContextMenuPluginType> = {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const ContextMenuPlugin = zeppelinGuildPlugin<ContextMenuPluginType>()({
|
export const ContextMenuPlugin = guildPlugin<ContextMenuPluginType>()({
|
||||||
name: "context_menu",
|
name: "context_menu",
|
||||||
showInDocs: false,
|
|
||||||
|
|
||||||
dependencies: () => [MutesPlugin, LogsPlugin, UtilityPlugin],
|
dependencies: () => [MutesPlugin, LogsPlugin, UtilityPlugin],
|
||||||
configParser: (input) => zContextMenusConfig.parse(input),
|
configParser: (input) => zContextMenusConfig.parse(input),
|
||||||
|
|
6
backend/src/plugins/ContextMenus/info.ts
Normal file
6
backend/src/plugins/ContextMenus/info.ts
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../../types";
|
||||||
|
|
||||||
|
export const contextMenuPluginInfo: ZeppelinPluginInfo = {
|
||||||
|
showInDocs: false,
|
||||||
|
prettyName: "Context menu",
|
||||||
|
};
|
|
@ -1,10 +1,9 @@
|
||||||
import { EventEmitter } from "events";
|
import { EventEmitter } from "events";
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions, guildPlugin } from "knub";
|
||||||
import { GuildCounters } from "../../data/GuildCounters";
|
import { GuildCounters } from "../../data/GuildCounters";
|
||||||
import { CounterTrigger, parseCounterConditionString } from "../../data/entities/CounterTrigger";
|
import { CounterTrigger, parseCounterConditionString } from "../../data/entities/CounterTrigger";
|
||||||
import { mapToPublicFn } from "../../pluginUtils";
|
import { mapToPublicFn } from "../../pluginUtils";
|
||||||
import { MINUTES, convertDelayStringToMS, values } from "../../utils";
|
import { MINUTES, convertDelayStringToMS, values } from "../../utils";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { AddCounterCmd } from "./commands/AddCounterCmd";
|
import { AddCounterCmd } from "./commands/AddCounterCmd";
|
||||||
import { CountersListCmd } from "./commands/CountersListCmd";
|
import { CountersListCmd } from "./commands/CountersListCmd";
|
||||||
import { ResetAllCounterValuesCmd } from "./commands/ResetAllCounterValuesCmd";
|
import { ResetAllCounterValuesCmd } from "./commands/ResetAllCounterValuesCmd";
|
||||||
|
@ -56,16 +55,8 @@ const defaultOptions: PluginOptions<CountersPluginType> = {
|
||||||
* A single trigger can only trigger once per user/channel/in general, depending on how specific the counter is (e.g. a per-user trigger can only trigger once per user).
|
* A single trigger can only trigger once per user/channel/in general, depending on how specific the counter is (e.g. a per-user trigger can only trigger once per user).
|
||||||
* After being triggered, a trigger is "reset" if the counter value no longer matches the trigger (e.g. drops to 100 or below in the above example). After this, that trigger can be triggered again.
|
* After being triggered, a trigger is "reset" if the counter value no longer matches the trigger (e.g. drops to 100 or below in the above example). After this, that trigger can be triggered again.
|
||||||
*/
|
*/
|
||||||
export const CountersPlugin = zeppelinGuildPlugin<CountersPluginType>()({
|
export const CountersPlugin = guildPlugin<CountersPluginType>()({
|
||||||
name: "counters",
|
name: "counters",
|
||||||
showInDocs: true,
|
|
||||||
info: {
|
|
||||||
prettyName: "Counters",
|
|
||||||
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: zCountersConfig,
|
|
||||||
},
|
|
||||||
|
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
// TODO: Separate input and output types
|
// TODO: Separate input and output types
|
||||||
|
|
11
backend/src/plugins/Counters/info.ts
Normal file
11
backend/src/plugins/Counters/info.ts
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../../types";
|
||||||
|
import { zCountersConfig } from "./types";
|
||||||
|
|
||||||
|
export const countersPluginInfo: ZeppelinPluginInfo = {
|
||||||
|
prettyName: "Counters",
|
||||||
|
showInDocs: true,
|
||||||
|
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: zCountersConfig,
|
||||||
|
};
|
|
@ -1,5 +1,5 @@
|
||||||
import { GuildChannel, GuildMember, User } from "discord.js";
|
import { GuildChannel, GuildMember, User } from "discord.js";
|
||||||
import { guildPluginMessageCommand, parseSignature } from "knub";
|
import { guildPlugin, guildPluginMessageCommand, parseSignature } from "knub";
|
||||||
import { TSignature } from "knub-command-manager";
|
import { TSignature } from "knub-command-manager";
|
||||||
import { commandTypes } from "../../commandTypes";
|
import { commandTypes } from "../../commandTypes";
|
||||||
import { TemplateSafeValueContainer, createTypedTemplateSafeValueContainer } from "../../templateFormatter";
|
import { TemplateSafeValueContainer, createTypedTemplateSafeValueContainer } from "../../templateFormatter";
|
||||||
|
@ -12,7 +12,6 @@ import {
|
||||||
userToTemplateSafeUser,
|
userToTemplateSafeUser,
|
||||||
} from "../../utils/templateSafeObjects";
|
} from "../../utils/templateSafeObjects";
|
||||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { runEvent } from "./functions/runEvent";
|
import { runEvent } from "./functions/runEvent";
|
||||||
import { CustomEventsPluginType, zCustomEventsConfig } from "./types";
|
import { CustomEventsPluginType, zCustomEventsConfig } from "./types";
|
||||||
|
|
||||||
|
@ -22,9 +21,8 @@ const defaultOptions = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const CustomEventsPlugin = zeppelinGuildPlugin<CustomEventsPluginType>()({
|
export const CustomEventsPlugin = guildPlugin<CustomEventsPluginType>()({
|
||||||
name: "custom_events",
|
name: "custom_events",
|
||||||
showInDocs: false,
|
|
||||||
|
|
||||||
dependencies: () => [LogsPlugin],
|
dependencies: () => [LogsPlugin],
|
||||||
configParser: (input) => zCustomEventsConfig.parse(input),
|
configParser: (input) => zCustomEventsConfig.parse(input),
|
||||||
|
|
6
backend/src/plugins/CustomEvents/info.ts
Normal file
6
backend/src/plugins/CustomEvents/info.ts
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../../types";
|
||||||
|
|
||||||
|
export const customEventsPluginInfo: ZeppelinPluginInfo = {
|
||||||
|
prettyName: "Custom events",
|
||||||
|
showInDocs: false,
|
||||||
|
};
|
|
@ -1,10 +1,9 @@
|
||||||
import { Guild } from "discord.js";
|
import { Guild } from "discord.js";
|
||||||
import { BasePluginType, GlobalPluginData, globalPluginEventListener } from "knub";
|
import { BasePluginType, GlobalPluginData, globalPlugin, globalPluginEventListener } from "knub";
|
||||||
import z from "zod";
|
import z from "zod";
|
||||||
import { AllowedGuilds } from "../../data/AllowedGuilds";
|
import { AllowedGuilds } from "../../data/AllowedGuilds";
|
||||||
import { Configs } from "../../data/Configs";
|
import { Configs } from "../../data/Configs";
|
||||||
import { env } from "../../env";
|
import { env } from "../../env";
|
||||||
import { zeppelinGlobalPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
|
|
||||||
interface GuildAccessMonitorPluginType extends BasePluginType {
|
interface GuildAccessMonitorPluginType extends BasePluginType {
|
||||||
state: {
|
state: {
|
||||||
|
@ -23,7 +22,7 @@ async function checkGuild(pluginData: GlobalPluginData<GuildAccessMonitorPluginT
|
||||||
/**
|
/**
|
||||||
* Global plugin to monitor if Zeppelin is invited to a non-whitelisted server, and leave it
|
* Global plugin to monitor if Zeppelin is invited to a non-whitelisted server, and leave it
|
||||||
*/
|
*/
|
||||||
export const GuildAccessMonitorPlugin = zeppelinGlobalPlugin<GuildAccessMonitorPluginType>()({
|
export const GuildAccessMonitorPlugin = globalPlugin<GuildAccessMonitorPluginType>()({
|
||||||
name: "guild_access_monitor",
|
name: "guild_access_monitor",
|
||||||
configParser: (input) => z.strictObject({}).parse(input),
|
configParser: (input) => z.strictObject({}).parse(input),
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
|
import { globalPlugin } from "knub";
|
||||||
import z from "zod";
|
import z from "zod";
|
||||||
import { Configs } from "../../data/Configs";
|
import { Configs } from "../../data/Configs";
|
||||||
import { zeppelinGlobalPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { reloadChangedGuilds } from "./functions/reloadChangedGuilds";
|
import { reloadChangedGuilds } from "./functions/reloadChangedGuilds";
|
||||||
import { GuildConfigReloaderPluginType } from "./types";
|
import { GuildConfigReloaderPluginType } from "./types";
|
||||||
|
|
||||||
export const GuildConfigReloaderPlugin = zeppelinGlobalPlugin<GuildConfigReloaderPluginType>()({
|
export const GuildConfigReloaderPlugin = globalPlugin<GuildConfigReloaderPluginType>()({
|
||||||
name: "guild_config_reloader",
|
name: "guild_config_reloader",
|
||||||
showInDocs: false,
|
|
||||||
|
|
||||||
configParser: (input) => z.strictObject({}).parse(input),
|
configParser: (input) => z.strictObject({}).parse(input),
|
||||||
|
|
||||||
|
|
6
backend/src/plugins/GuildConfigReloader/info.ts
Normal file
6
backend/src/plugins/GuildConfigReloader/info.ts
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../../types";
|
||||||
|
|
||||||
|
export const guildConfigReloaderPluginInfo: ZeppelinPluginInfo = {
|
||||||
|
prettyName: "Guild config reloader",
|
||||||
|
showInDocs: false,
|
||||||
|
};
|
|
@ -1,15 +1,13 @@
|
||||||
import { Guild } from "discord.js";
|
import { Guild } from "discord.js";
|
||||||
import { guildPluginEventListener } from "knub";
|
import { guildPlugin, guildPluginEventListener } from "knub";
|
||||||
import z from "zod";
|
import z from "zod";
|
||||||
import { AllowedGuilds } from "../../data/AllowedGuilds";
|
import { AllowedGuilds } from "../../data/AllowedGuilds";
|
||||||
import { ApiPermissionAssignments } from "../../data/ApiPermissionAssignments";
|
import { ApiPermissionAssignments } from "../../data/ApiPermissionAssignments";
|
||||||
import { MINUTES } from "../../utils";
|
import { MINUTES } from "../../utils";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { GuildInfoSaverPluginType } from "./types";
|
import { GuildInfoSaverPluginType } from "./types";
|
||||||
|
|
||||||
export const GuildInfoSaverPlugin = zeppelinGuildPlugin<GuildInfoSaverPluginType>()({
|
export const GuildInfoSaverPlugin = guildPlugin<GuildInfoSaverPluginType>()({
|
||||||
name: "guild_info_saver",
|
name: "guild_info_saver",
|
||||||
showInDocs: false,
|
|
||||||
|
|
||||||
configParser: (input) => z.strictObject({}).parse(input),
|
configParser: (input) => z.strictObject({}).parse(input),
|
||||||
|
|
||||||
|
|
6
backend/src/plugins/GuildInfoSaver/info.ts
Normal file
6
backend/src/plugins/GuildInfoSaver/info.ts
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../../types";
|
||||||
|
|
||||||
|
export const guildInfoSaverPluginInfo: ZeppelinPluginInfo = {
|
||||||
|
prettyName: "Guild info saver",
|
||||||
|
showInDocs: false,
|
||||||
|
};
|
|
@ -1,8 +1,8 @@
|
||||||
|
import { guildPlugin } from "knub";
|
||||||
import z from "zod";
|
import z from "zod";
|
||||||
import { GuildMemberCache } from "../../data/GuildMemberCache";
|
import { GuildMemberCache } from "../../data/GuildMemberCache";
|
||||||
import { mapToPublicFn } from "../../pluginUtils";
|
import { mapToPublicFn } from "../../pluginUtils";
|
||||||
import { SECONDS } from "../../utils";
|
import { SECONDS } from "../../utils";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { cancelDeletionOnMemberJoin } from "./events/cancelDeletionOnMemberJoin";
|
import { cancelDeletionOnMemberJoin } from "./events/cancelDeletionOnMemberJoin";
|
||||||
import { removeMemberCacheOnMemberLeave } from "./events/removeMemberCacheOnMemberLeave";
|
import { removeMemberCacheOnMemberLeave } from "./events/removeMemberCacheOnMemberLeave";
|
||||||
import { updateMemberCacheOnMemberUpdate } from "./events/updateMemberCacheOnMemberUpdate";
|
import { updateMemberCacheOnMemberUpdate } from "./events/updateMemberCacheOnMemberUpdate";
|
||||||
|
@ -14,9 +14,8 @@ import { GuildMemberCachePluginType } from "./types";
|
||||||
|
|
||||||
const PENDING_SAVE_INTERVAL = 30 * SECONDS;
|
const PENDING_SAVE_INTERVAL = 30 * SECONDS;
|
||||||
|
|
||||||
export const GuildMemberCachePlugin = zeppelinGuildPlugin<GuildMemberCachePluginType>()({
|
export const GuildMemberCachePlugin = guildPlugin<GuildMemberCachePluginType>()({
|
||||||
name: "guild_member_cache",
|
name: "guild_member_cache",
|
||||||
showInDocs: false,
|
|
||||||
|
|
||||||
configParser: (input) => z.strictObject({}).parse(input),
|
configParser: (input) => z.strictObject({}).parse(input),
|
||||||
|
|
||||||
|
|
6
backend/src/plugins/GuildMemberCache/info.ts
Normal file
6
backend/src/plugins/GuildMemberCache/info.ts
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../../types";
|
||||||
|
|
||||||
|
export const guildMemberCachePluginInfo: ZeppelinPluginInfo = {
|
||||||
|
prettyName: "Guild member cache",
|
||||||
|
showInDocs: false,
|
||||||
|
};
|
|
@ -1,9 +1,8 @@
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions, guildPlugin } from "knub";
|
||||||
import z from "zod";
|
import z from "zod";
|
||||||
import { Queue } from "../../Queue";
|
import { Queue } from "../../Queue";
|
||||||
import { Webhooks } from "../../data/Webhooks";
|
import { Webhooks } from "../../data/Webhooks";
|
||||||
import { mapToPublicFn } from "../../pluginUtils";
|
import { mapToPublicFn } from "../../pluginUtils";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { editMessage } from "./functions/editMessage";
|
import { editMessage } from "./functions/editMessage";
|
||||||
import { sendMessage } from "./functions/sendMessage";
|
import { sendMessage } from "./functions/sendMessage";
|
||||||
import { InternalPosterPluginType } from "./types";
|
import { InternalPosterPluginType } from "./types";
|
||||||
|
@ -13,9 +12,8 @@ const defaultOptions: PluginOptions<InternalPosterPluginType> = {
|
||||||
overrides: [],
|
overrides: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const InternalPosterPlugin = zeppelinGuildPlugin<InternalPosterPluginType>()({
|
export const InternalPosterPlugin = guildPlugin<InternalPosterPluginType>()({
|
||||||
name: "internal_poster",
|
name: "internal_poster",
|
||||||
showInDocs: false,
|
|
||||||
|
|
||||||
configParser: (input) => z.strictObject({}).parse(input),
|
configParser: (input) => z.strictObject({}).parse(input),
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
|
|
6
backend/src/plugins/InternalPoster/info.ts
Normal file
6
backend/src/plugins/InternalPoster/info.ts
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../../types";
|
||||||
|
|
||||||
|
export const internalPosterPluginInfo: ZeppelinPluginInfo = {
|
||||||
|
prettyName: "Internal poster",
|
||||||
|
showInDocs: false,
|
||||||
|
};
|
|
@ -1,8 +1,6 @@
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions, guildPlugin } from "knub";
|
||||||
import { onGuildEvent } from "../../data/GuildEvents";
|
import { onGuildEvent } from "../../data/GuildEvents";
|
||||||
import { GuildVCAlerts } from "../../data/GuildVCAlerts";
|
import { GuildVCAlerts } from "../../data/GuildVCAlerts";
|
||||||
import { trimPluginDescription } from "../../utils";
|
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { FollowCmd } from "./commands/FollowCmd";
|
import { FollowCmd } from "./commands/FollowCmd";
|
||||||
import { DeleteFollowCmd, ListFollowCmd } from "./commands/ListFollowCmd";
|
import { DeleteFollowCmd, ListFollowCmd } from "./commands/ListFollowCmd";
|
||||||
import { WhereCmd } from "./commands/WhereCmd";
|
import { WhereCmd } from "./commands/WhereCmd";
|
||||||
|
@ -28,18 +26,8 @@ const defaultOptions: PluginOptions<LocateUserPluginType> = {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const LocateUserPlugin = zeppelinGuildPlugin<LocateUserPluginType>()({
|
export const LocateUserPlugin = guildPlugin<LocateUserPluginType>()({
|
||||||
name: "locate_user",
|
name: "locate_user",
|
||||||
showInDocs: true,
|
|
||||||
info: {
|
|
||||||
prettyName: "Locate user",
|
|
||||||
description: trimPluginDescription(`
|
|
||||||
This plugin allows users with access to the commands the following:
|
|
||||||
* 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: zLocateUserConfig,
|
|
||||||
},
|
|
||||||
|
|
||||||
configParser: (input) => zLocateUserConfig.parse(input),
|
configParser: (input) => zLocateUserConfig.parse(input),
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
|
|
14
backend/src/plugins/LocateUser/info.ts
Normal file
14
backend/src/plugins/LocateUser/info.ts
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../../types";
|
||||||
|
import { trimPluginDescription } from "../../utils";
|
||||||
|
import { zLocateUserConfig } from "./types";
|
||||||
|
|
||||||
|
export const locateUserPluginInfo: ZeppelinPluginInfo = {
|
||||||
|
prettyName: "Locate user",
|
||||||
|
description: trimPluginDescription(`
|
||||||
|
This plugin allows users with access to the commands the following:
|
||||||
|
* 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: zLocateUserConfig,
|
||||||
|
showInDocs: true,
|
||||||
|
};
|
|
@ -1,4 +1,4 @@
|
||||||
import { CooldownManager, PluginOptions } from "knub";
|
import { CooldownManager, PluginOptions, guildPlugin } from "knub";
|
||||||
import DefaultLogMessages from "../../data/DefaultLogMessages.json";
|
import DefaultLogMessages from "../../data/DefaultLogMessages.json";
|
||||||
import { GuildArchives } from "../../data/GuildArchives";
|
import { GuildArchives } from "../../data/GuildArchives";
|
||||||
import { GuildCases } from "../../data/GuildCases";
|
import { GuildCases } from "../../data/GuildCases";
|
||||||
|
@ -10,7 +10,6 @@ import { mapToPublicFn } from "../../pluginUtils";
|
||||||
import { discardRegExpRunner, getRegExpRunner } from "../../regExpRunners";
|
import { discardRegExpRunner, getRegExpRunner } from "../../regExpRunners";
|
||||||
import { TypedTemplateSafeValueContainer, createTypedTemplateSafeValueContainer } from "../../templateFormatter";
|
import { TypedTemplateSafeValueContainer, createTypedTemplateSafeValueContainer } from "../../templateFormatter";
|
||||||
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { LogsChannelCreateEvt, LogsChannelDeleteEvt, LogsChannelUpdateEvt } from "./events/LogsChannelModifyEvts";
|
import { LogsChannelCreateEvt, LogsChannelDeleteEvt, LogsChannelUpdateEvt } from "./events/LogsChannelModifyEvts";
|
||||||
import {
|
import {
|
||||||
LogsEmojiCreateEvt,
|
LogsEmojiCreateEvt,
|
||||||
|
@ -140,13 +139,8 @@ const defaultOptions: PluginOptions<LogsPluginType> = {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const LogsPlugin = zeppelinGuildPlugin<LogsPluginType>()({
|
export const LogsPlugin = guildPlugin<LogsPluginType>()({
|
||||||
name: "logs",
|
name: "logs",
|
||||||
showInDocs: true,
|
|
||||||
info: {
|
|
||||||
prettyName: "Logs",
|
|
||||||
configSchema: zLogsConfig,
|
|
||||||
},
|
|
||||||
|
|
||||||
dependencies: async () => [TimeAndDatePlugin, InternalPosterPlugin, (await getCasesPlugin()).CasesPlugin],
|
dependencies: async () => [TimeAndDatePlugin, InternalPosterPlugin, (await getCasesPlugin()).CasesPlugin],
|
||||||
configParser: (input) => zLogsConfig.parse(input),
|
configParser: (input) => zLogsConfig.parse(input),
|
||||||
|
|
8
backend/src/plugins/Logs/info.ts
Normal file
8
backend/src/plugins/Logs/info.ts
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../../types";
|
||||||
|
import { zLogsConfig } from "./types";
|
||||||
|
|
||||||
|
export const logsPluginInfo: ZeppelinPluginInfo = {
|
||||||
|
prettyName: "Logs",
|
||||||
|
configSchema: zLogsConfig,
|
||||||
|
showInDocs: true,
|
||||||
|
};
|
|
@ -1,6 +1,5 @@
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions, guildPlugin } from "knub";
|
||||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { SaveMessagesToDBCmd } from "./commands/SaveMessagesToDB";
|
import { SaveMessagesToDBCmd } from "./commands/SaveMessagesToDB";
|
||||||
import { SavePinsToDBCmd } from "./commands/SavePinsToDB";
|
import { SavePinsToDBCmd } from "./commands/SavePinsToDB";
|
||||||
import { MessageCreateEvt, MessageDeleteBulkEvt, MessageDeleteEvt, MessageUpdateEvt } from "./events/SaveMessagesEvts";
|
import { MessageCreateEvt, MessageDeleteBulkEvt, MessageDeleteEvt, MessageUpdateEvt } from "./events/SaveMessagesEvts";
|
||||||
|
@ -20,9 +19,8 @@ const defaultOptions: PluginOptions<MessageSaverPluginType> = {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const MessageSaverPlugin = zeppelinGuildPlugin<MessageSaverPluginType>()({
|
export const MessageSaverPlugin = guildPlugin<MessageSaverPluginType>()({
|
||||||
name: "message_saver",
|
name: "message_saver",
|
||||||
showInDocs: false,
|
|
||||||
|
|
||||||
configParser: (input) => zMessageSaverConfig.parse(input),
|
configParser: (input) => zMessageSaverConfig.parse(input),
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
|
|
6
backend/src/plugins/MessageSaver/info.ts
Normal file
6
backend/src/plugins/MessageSaver/info.ts
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../../types";
|
||||||
|
|
||||||
|
export const messageSaverPluginInfo: ZeppelinPluginInfo = {
|
||||||
|
prettyName: "Message saver",
|
||||||
|
showInDocs: false,
|
||||||
|
};
|
|
@ -1,5 +1,6 @@
|
||||||
import { GuildMember, Message, Snowflake } from "discord.js";
|
import { GuildMember, Message, Snowflake } from "discord.js";
|
||||||
import { EventEmitter } from "events";
|
import { EventEmitter } from "events";
|
||||||
|
import { guildPlugin } from "knub";
|
||||||
import { Queue } from "../../Queue";
|
import { Queue } from "../../Queue";
|
||||||
import { GuildCases } from "../../data/GuildCases";
|
import { GuildCases } from "../../data/GuildCases";
|
||||||
import { onGuildEvent } from "../../data/GuildEvents";
|
import { onGuildEvent } from "../../data/GuildEvents";
|
||||||
|
@ -7,12 +8,11 @@ import { GuildLogs } from "../../data/GuildLogs";
|
||||||
import { GuildMutes } from "../../data/GuildMutes";
|
import { GuildMutes } from "../../data/GuildMutes";
|
||||||
import { GuildTempbans } from "../../data/GuildTempbans";
|
import { GuildTempbans } from "../../data/GuildTempbans";
|
||||||
import { mapToPublicFn } from "../../pluginUtils";
|
import { mapToPublicFn } from "../../pluginUtils";
|
||||||
import { MINUTES, trimPluginDescription } from "../../utils";
|
import { MINUTES } from "../../utils";
|
||||||
import { CasesPlugin } from "../Cases/CasesPlugin";
|
import { CasesPlugin } from "../Cases/CasesPlugin";
|
||||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||||
import { MutesPlugin } from "../Mutes/MutesPlugin";
|
import { MutesPlugin } from "../Mutes/MutesPlugin";
|
||||||
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { AddCaseCmd } from "./commands/AddCaseCmd";
|
import { AddCaseCmd } from "./commands/AddCaseCmd";
|
||||||
import { BanCmd } from "./commands/BanCmd";
|
import { BanCmd } from "./commands/BanCmd";
|
||||||
import { CaseCmd } from "./commands/CaseCmd";
|
import { CaseCmd } from "./commands/CaseCmd";
|
||||||
|
@ -113,16 +113,8 @@ const defaultOptions = {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const ModActionsPlugin = zeppelinGuildPlugin<ModActionsPluginType>()({
|
export const ModActionsPlugin = guildPlugin<ModActionsPluginType>()({
|
||||||
name: "mod_actions",
|
name: "mod_actions",
|
||||||
showInDocs: true,
|
|
||||||
info: {
|
|
||||||
prettyName: "Mod actions",
|
|
||||||
description: trimPluginDescription(`
|
|
||||||
This plugin contains the 'typical' mod actions such as warning, muting, kicking, banning, etc.
|
|
||||||
`),
|
|
||||||
configSchema: zModActionsConfig,
|
|
||||||
},
|
|
||||||
|
|
||||||
dependencies: () => [TimeAndDatePlugin, CasesPlugin, MutesPlugin, LogsPlugin],
|
dependencies: () => [TimeAndDatePlugin, CasesPlugin, MutesPlugin, LogsPlugin],
|
||||||
configParser: (input) => zModActionsConfig.parse(input),
|
configParser: (input) => zModActionsConfig.parse(input),
|
||||||
|
|
12
backend/src/plugins/ModActions/info.ts
Normal file
12
backend/src/plugins/ModActions/info.ts
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../../types";
|
||||||
|
import { trimPluginDescription } from "../../utils";
|
||||||
|
import { zModActionsConfig } from "./types";
|
||||||
|
|
||||||
|
export const modActionsPluginInfo: ZeppelinPluginInfo = {
|
||||||
|
prettyName: "Mod actions",
|
||||||
|
showInDocs: true,
|
||||||
|
description: trimPluginDescription(`
|
||||||
|
This plugin contains the 'typical' mod actions such as warning, muting, kicking, banning, etc.
|
||||||
|
`),
|
||||||
|
configSchema: zModActionsConfig,
|
||||||
|
};
|
|
@ -1,5 +1,6 @@
|
||||||
import { GuildMember, Snowflake } from "discord.js";
|
import { GuildMember, Snowflake } from "discord.js";
|
||||||
import { EventEmitter } from "events";
|
import { EventEmitter } from "events";
|
||||||
|
import { guildPlugin } from "knub";
|
||||||
import { GuildArchives } from "../../data/GuildArchives";
|
import { GuildArchives } from "../../data/GuildArchives";
|
||||||
import { GuildCases } from "../../data/GuildCases";
|
import { GuildCases } from "../../data/GuildCases";
|
||||||
import { onGuildEvent } from "../../data/GuildEvents";
|
import { onGuildEvent } from "../../data/GuildEvents";
|
||||||
|
@ -9,7 +10,6 @@ import { mapToPublicFn } from "../../pluginUtils";
|
||||||
import { CasesPlugin } from "../Cases/CasesPlugin";
|
import { CasesPlugin } from "../Cases/CasesPlugin";
|
||||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||||
import { RoleManagerPlugin } from "../RoleManager/RoleManagerPlugin.js";
|
import { RoleManagerPlugin } from "../RoleManager/RoleManagerPlugin.js";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { ClearBannedMutesCmd } from "./commands/ClearBannedMutesCmd";
|
import { ClearBannedMutesCmd } from "./commands/ClearBannedMutesCmd";
|
||||||
import { ClearMutesCmd } from "./commands/ClearMutesCmd";
|
import { ClearMutesCmd } from "./commands/ClearMutesCmd";
|
||||||
import { ClearMutesWithoutRoleCmd } from "./commands/ClearMutesWithoutRoleCmd";
|
import { ClearMutesWithoutRoleCmd } from "./commands/ClearMutesWithoutRoleCmd";
|
||||||
|
@ -61,13 +61,8 @@ const defaultOptions = {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const MutesPlugin = zeppelinGuildPlugin<MutesPluginType>()({
|
export const MutesPlugin = guildPlugin<MutesPluginType>()({
|
||||||
name: "mutes",
|
name: "mutes",
|
||||||
showInDocs: true,
|
|
||||||
info: {
|
|
||||||
prettyName: "Mutes",
|
|
||||||
configSchema: zMutesConfig,
|
|
||||||
},
|
|
||||||
|
|
||||||
dependencies: () => [CasesPlugin, LogsPlugin, RoleManagerPlugin],
|
dependencies: () => [CasesPlugin, LogsPlugin, RoleManagerPlugin],
|
||||||
configParser: (input) => zMutesConfig.parse(input),
|
configParser: (input) => zMutesConfig.parse(input),
|
||||||
|
|
8
backend/src/plugins/Mutes/info.ts
Normal file
8
backend/src/plugins/Mutes/info.ts
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../../types";
|
||||||
|
import { zMutesConfig } from "./types";
|
||||||
|
|
||||||
|
export const mutesPluginInfo: ZeppelinPluginInfo = {
|
||||||
|
prettyName: "Mutes",
|
||||||
|
showInDocs: true,
|
||||||
|
configSchema: zMutesConfig,
|
||||||
|
};
|
|
@ -1,8 +1,7 @@
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions, guildPlugin } from "knub";
|
||||||
import { Queue } from "../../Queue";
|
import { Queue } from "../../Queue";
|
||||||
import { GuildNicknameHistory } from "../../data/GuildNicknameHistory";
|
import { GuildNicknameHistory } from "../../data/GuildNicknameHistory";
|
||||||
import { UsernameHistory } from "../../data/UsernameHistory";
|
import { UsernameHistory } from "../../data/UsernameHistory";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { NamesCmd } from "./commands/NamesCmd";
|
import { NamesCmd } from "./commands/NamesCmd";
|
||||||
import { NameHistoryPluginType, zNameHistoryConfig } from "./types";
|
import { NameHistoryPluginType, zNameHistoryConfig } from "./types";
|
||||||
|
|
||||||
|
@ -20,9 +19,8 @@ const defaultOptions: PluginOptions<NameHistoryPluginType> = {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const NameHistoryPlugin = zeppelinGuildPlugin<NameHistoryPluginType>()({
|
export const NameHistoryPlugin = guildPlugin<NameHistoryPluginType>()({
|
||||||
name: "name_history",
|
name: "name_history",
|
||||||
showInDocs: false,
|
|
||||||
|
|
||||||
configParser: (input) => zNameHistoryConfig.parse(input),
|
configParser: (input) => zNameHistoryConfig.parse(input),
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
|
|
8
backend/src/plugins/NameHistory/info.ts
Normal file
8
backend/src/plugins/NameHistory/info.ts
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../../types";
|
||||||
|
import { zNameHistoryConfig } from "./types";
|
||||||
|
|
||||||
|
export const nameHistoryPluginInfo: ZeppelinPluginInfo = {
|
||||||
|
prettyName: "Name history",
|
||||||
|
showInDocs: false,
|
||||||
|
configSchema: zNameHistoryConfig,
|
||||||
|
};
|
|
@ -1,10 +1,8 @@
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions, guildPlugin } from "knub";
|
||||||
import { GuildLogs } from "../../data/GuildLogs";
|
import { GuildLogs } from "../../data/GuildLogs";
|
||||||
import { GuildPersistedData } from "../../data/GuildPersistedData";
|
import { GuildPersistedData } from "../../data/GuildPersistedData";
|
||||||
import { trimPluginDescription } from "../../utils";
|
|
||||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||||
import { RoleManagerPlugin } from "../RoleManager/RoleManagerPlugin";
|
import { RoleManagerPlugin } from "../RoleManager/RoleManagerPlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { LoadDataEvt } from "./events/LoadDataEvt";
|
import { LoadDataEvt } from "./events/LoadDataEvt";
|
||||||
import { StoreDataEvt } from "./events/StoreDataEvt";
|
import { StoreDataEvt } from "./events/StoreDataEvt";
|
||||||
import { PersistPluginType, zPersistConfig } from "./types";
|
import { PersistPluginType, zPersistConfig } from "./types";
|
||||||
|
@ -17,17 +15,8 @@ const defaultOptions: PluginOptions<PersistPluginType> = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const PersistPlugin = zeppelinGuildPlugin<PersistPluginType>()({
|
export const PersistPlugin = guildPlugin<PersistPluginType>()({
|
||||||
name: "persist",
|
name: "persist",
|
||||||
showInDocs: true,
|
|
||||||
info: {
|
|
||||||
prettyName: "Persist",
|
|
||||||
description: trimPluginDescription(`
|
|
||||||
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: zPersistConfig,
|
|
||||||
},
|
|
||||||
|
|
||||||
dependencies: () => [LogsPlugin, RoleManagerPlugin],
|
dependencies: () => [LogsPlugin, RoleManagerPlugin],
|
||||||
configParser: (input) => zPersistConfig.parse(input),
|
configParser: (input) => zPersistConfig.parse(input),
|
||||||
|
|
13
backend/src/plugins/Persist/info.ts
Normal file
13
backend/src/plugins/Persist/info.ts
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../../types";
|
||||||
|
import { trimPluginDescription } from "../../utils";
|
||||||
|
import { zPersistConfig } from "./types";
|
||||||
|
|
||||||
|
export const persistPluginInfo: ZeppelinPluginInfo = {
|
||||||
|
prettyName: "Persist",
|
||||||
|
description: trimPluginDescription(`
|
||||||
|
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: zPersistConfig,
|
||||||
|
showInDocs: true,
|
||||||
|
};
|
|
@ -1,9 +1,7 @@
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions, guildPlugin } from "knub";
|
||||||
import { hasPhishermanMasterAPIKey, phishermanApiKeyIsValid } from "../../data/Phisherman";
|
import { hasPhishermanMasterAPIKey, phishermanApiKeyIsValid } from "../../data/Phisherman";
|
||||||
import { mapToPublicFn } from "../../pluginUtils";
|
import { mapToPublicFn } from "../../pluginUtils";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { getDomainInfo } from "./functions/getDomainInfo";
|
import { getDomainInfo } from "./functions/getDomainInfo";
|
||||||
import { pluginInfo } from "./info";
|
|
||||||
import { PhishermanPluginType, zPhishermanConfig } from "./types";
|
import { PhishermanPluginType, zPhishermanConfig } from "./types";
|
||||||
|
|
||||||
const defaultOptions: PluginOptions<PhishermanPluginType> = {
|
const defaultOptions: PluginOptions<PhishermanPluginType> = {
|
||||||
|
@ -13,10 +11,8 @@ const defaultOptions: PluginOptions<PhishermanPluginType> = {
|
||||||
overrides: [],
|
overrides: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const PhishermanPlugin = zeppelinGuildPlugin<PhishermanPluginType>()({
|
export const PhishermanPlugin = guildPlugin<PhishermanPluginType>()({
|
||||||
name: "phisherman",
|
name: "phisherman",
|
||||||
showInDocs: true,
|
|
||||||
info: pluginInfo,
|
|
||||||
|
|
||||||
configParser: (input) => zPhishermanConfig.parse(input),
|
configParser: (input) => zPhishermanConfig.parse(input),
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../../types";
|
||||||
import { trimPluginDescription } from "../../utils";
|
import { trimPluginDescription } from "../../utils";
|
||||||
import { ZeppelinGuildPluginBlueprint } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { zPhishermanConfig } from "./types";
|
import { zPhishermanConfig } from "./types";
|
||||||
|
|
||||||
export const pluginInfo: ZeppelinGuildPluginBlueprint["info"] = {
|
export const phishermanPluginInfo: ZeppelinPluginInfo = {
|
||||||
prettyName: "Phisherman",
|
prettyName: "Phisherman",
|
||||||
description: trimPluginDescription(`
|
description: trimPluginDescription(`
|
||||||
Match scam/phishing links using the Phisherman API. See https://phisherman.gg/ for more details!
|
Match scam/phishing links using the Phisherman API. See https://phisherman.gg/ for more details!
|
||||||
|
@ -40,4 +40,5 @@ export const pluginInfo: ZeppelinGuildPluginBlueprint["info"] = {
|
||||||
~~~
|
~~~
|
||||||
`),
|
`),
|
||||||
configSchema: zPhishermanConfig,
|
configSchema: zPhishermanConfig,
|
||||||
|
showInDocs: true,
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions, guildPlugin } from "knub";
|
||||||
import { GuildPingableRoles } from "../../data/GuildPingableRoles";
|
import { GuildPingableRoles } from "../../data/GuildPingableRoles";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { PingableRoleDisableCmd } from "./commands/PingableRoleDisableCmd";
|
import { PingableRoleDisableCmd } from "./commands/PingableRoleDisableCmd";
|
||||||
import { PingableRoleEnableCmd } from "./commands/PingableRoleEnableCmd";
|
import { PingableRoleEnableCmd } from "./commands/PingableRoleEnableCmd";
|
||||||
import { PingableRolesPluginType, zPingableRolesConfig } from "./types";
|
import { PingableRolesPluginType, zPingableRolesConfig } from "./types";
|
||||||
|
@ -19,13 +18,8 @@ const defaultOptions: PluginOptions<PingableRolesPluginType> = {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const PingableRolesPlugin = zeppelinGuildPlugin<PingableRolesPluginType>()({
|
export const PingableRolesPlugin = guildPlugin<PingableRolesPluginType>()({
|
||||||
name: "pingable_roles",
|
name: "pingable_roles",
|
||||||
showInDocs: true,
|
|
||||||
info: {
|
|
||||||
prettyName: "Pingable roles",
|
|
||||||
configSchema: zPingableRolesConfig,
|
|
||||||
},
|
|
||||||
|
|
||||||
configParser: (input) => zPingableRolesConfig.parse(input),
|
configParser: (input) => zPingableRolesConfig.parse(input),
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
|
|
8
backend/src/plugins/PingableRoles/info.ts
Normal file
8
backend/src/plugins/PingableRoles/info.ts
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../../types";
|
||||||
|
import { zPingableRolesConfig } from "./types";
|
||||||
|
|
||||||
|
export const pingableRolesPluginInfo: ZeppelinPluginInfo = {
|
||||||
|
prettyName: "Pingable roles",
|
||||||
|
configSchema: zPingableRolesConfig,
|
||||||
|
showInDocs: true,
|
||||||
|
};
|
|
@ -1,11 +1,10 @@
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions, guildPlugin } from "knub";
|
||||||
import { onGuildEvent } from "../../data/GuildEvents";
|
import { onGuildEvent } from "../../data/GuildEvents";
|
||||||
import { GuildLogs } from "../../data/GuildLogs";
|
import { GuildLogs } from "../../data/GuildLogs";
|
||||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||||
import { GuildScheduledPosts } from "../../data/GuildScheduledPosts";
|
import { GuildScheduledPosts } from "../../data/GuildScheduledPosts";
|
||||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||||
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { EditCmd } from "./commands/EditCmd";
|
import { EditCmd } from "./commands/EditCmd";
|
||||||
import { EditEmbedCmd } from "./commands/EditEmbedCmd";
|
import { EditEmbedCmd } from "./commands/EditEmbedCmd";
|
||||||
import { PostCmd } from "./commands/PostCmd";
|
import { PostCmd } from "./commands/PostCmd";
|
||||||
|
@ -30,13 +29,8 @@ const defaultOptions: PluginOptions<PostPluginType> = {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const PostPlugin = zeppelinGuildPlugin<PostPluginType>()({
|
export const PostPlugin = guildPlugin<PostPluginType>()({
|
||||||
name: "post",
|
name: "post",
|
||||||
showInDocs: true,
|
|
||||||
info: {
|
|
||||||
prettyName: "Post",
|
|
||||||
configSchema: zPostConfig,
|
|
||||||
},
|
|
||||||
|
|
||||||
dependencies: () => [TimeAndDatePlugin, LogsPlugin],
|
dependencies: () => [TimeAndDatePlugin, LogsPlugin],
|
||||||
configParser: (input) => zPostConfig.parse(input),
|
configParser: (input) => zPostConfig.parse(input),
|
||||||
|
|
8
backend/src/plugins/Post/info.ts
Normal file
8
backend/src/plugins/Post/info.ts
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../../types";
|
||||||
|
import { zPostConfig } from "./types";
|
||||||
|
|
||||||
|
export const postPluginInfo: ZeppelinPluginInfo = {
|
||||||
|
prettyName: "Post",
|
||||||
|
configSchema: zPostConfig,
|
||||||
|
showInDocs: true,
|
||||||
|
};
|
|
@ -1,9 +1,8 @@
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions, guildPlugin } from "knub";
|
||||||
import { Queue } from "../../Queue";
|
import { Queue } from "../../Queue";
|
||||||
import { GuildReactionRoles } from "../../data/GuildReactionRoles";
|
import { GuildReactionRoles } from "../../data/GuildReactionRoles";
|
||||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { ClearReactionRolesCmd } from "./commands/ClearReactionRolesCmd";
|
import { ClearReactionRolesCmd } from "./commands/ClearReactionRolesCmd";
|
||||||
import { InitReactionRolesCmd } from "./commands/InitReactionRolesCmd";
|
import { InitReactionRolesCmd } from "./commands/InitReactionRolesCmd";
|
||||||
import { RefreshReactionRolesCmd } from "./commands/RefreshReactionRolesCmd";
|
import { RefreshReactionRolesCmd } from "./commands/RefreshReactionRolesCmd";
|
||||||
|
@ -33,14 +32,8 @@ const defaultOptions: PluginOptions<ReactionRolesPluginType> = {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const ReactionRolesPlugin = zeppelinGuildPlugin<ReactionRolesPluginType>()({
|
export const ReactionRolesPlugin = guildPlugin<ReactionRolesPluginType>()({
|
||||||
name: "reaction_roles",
|
name: "reaction_roles",
|
||||||
showInDocs: true,
|
|
||||||
info: {
|
|
||||||
prettyName: "Reaction roles",
|
|
||||||
legacy: "Consider using the [Role buttons](/docs/plugins/role_buttons) plugin instead.",
|
|
||||||
configSchema: zReactionRolesConfig,
|
|
||||||
},
|
|
||||||
|
|
||||||
dependencies: () => [LogsPlugin],
|
dependencies: () => [LogsPlugin],
|
||||||
configParser: (input) => zReactionRolesConfig.parse(input),
|
configParser: (input) => zReactionRolesConfig.parse(input),
|
||||||
|
|
10
backend/src/plugins/ReactionRoles/info.ts
Normal file
10
backend/src/plugins/ReactionRoles/info.ts
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../../types";
|
||||||
|
import { zReactionRolesConfig } from "./types";
|
||||||
|
|
||||||
|
export const reactionRolesPluginInfo: ZeppelinPluginInfo = {
|
||||||
|
prettyName: "Reaction roles",
|
||||||
|
description: "Consider using the [Role buttons](https://zeppelin.gg/docs/plugins/role_buttons) plugin instead.",
|
||||||
|
legacy: true,
|
||||||
|
configSchema: zReactionRolesConfig,
|
||||||
|
showInDocs: true,
|
||||||
|
};
|
|
@ -1,8 +1,7 @@
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions, guildPlugin } from "knub";
|
||||||
import { onGuildEvent } from "../../data/GuildEvents";
|
import { onGuildEvent } from "../../data/GuildEvents";
|
||||||
import { GuildReminders } from "../../data/GuildReminders";
|
import { GuildReminders } from "../../data/GuildReminders";
|
||||||
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { RemindCmd } from "./commands/RemindCmd";
|
import { RemindCmd } from "./commands/RemindCmd";
|
||||||
import { RemindersCmd } from "./commands/RemindersCmd";
|
import { RemindersCmd } from "./commands/RemindersCmd";
|
||||||
import { RemindersDeleteCmd } from "./commands/RemindersDeleteCmd";
|
import { RemindersDeleteCmd } from "./commands/RemindersDeleteCmd";
|
||||||
|
@ -23,13 +22,8 @@ const defaultOptions: PluginOptions<RemindersPluginType> = {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const RemindersPlugin = zeppelinGuildPlugin<RemindersPluginType>()({
|
export const RemindersPlugin = guildPlugin<RemindersPluginType>()({
|
||||||
name: "reminders",
|
name: "reminders",
|
||||||
showInDocs: true,
|
|
||||||
info: {
|
|
||||||
prettyName: "Reminders",
|
|
||||||
configSchema: zRemindersConfig,
|
|
||||||
},
|
|
||||||
|
|
||||||
dependencies: () => [TimeAndDatePlugin],
|
dependencies: () => [TimeAndDatePlugin],
|
||||||
configParser: (input) => zRemindersConfig.parse(input),
|
configParser: (input) => zRemindersConfig.parse(input),
|
||||||
|
|
8
backend/src/plugins/Reminders/info.ts
Normal file
8
backend/src/plugins/Reminders/info.ts
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../../types";
|
||||||
|
import { zRemindersConfig } from "./types";
|
||||||
|
|
||||||
|
export const remindersPluginInfo: ZeppelinPluginInfo = {
|
||||||
|
prettyName: "Reminders",
|
||||||
|
configSchema: zRemindersConfig,
|
||||||
|
showInDocs: true,
|
||||||
|
};
|
|
@ -1,17 +1,14 @@
|
||||||
|
import { guildPlugin } from "knub";
|
||||||
import { GuildRoleButtons } from "../../data/GuildRoleButtons";
|
import { GuildRoleButtons } from "../../data/GuildRoleButtons";
|
||||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||||
import { RoleManagerPlugin } from "../RoleManager/RoleManagerPlugin";
|
import { RoleManagerPlugin } from "../RoleManager/RoleManagerPlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { resetButtonsCmd } from "./commands/resetButtons";
|
import { resetButtonsCmd } from "./commands/resetButtons";
|
||||||
import { onButtonInteraction } from "./events/buttonInteraction";
|
import { onButtonInteraction } from "./events/buttonInteraction";
|
||||||
import { applyAllRoleButtons } from "./functions/applyAllRoleButtons";
|
import { applyAllRoleButtons } from "./functions/applyAllRoleButtons";
|
||||||
import { pluginInfo } from "./info";
|
|
||||||
import { RoleButtonsPluginType, zRoleButtonsConfig } from "./types";
|
import { RoleButtonsPluginType, zRoleButtonsConfig } from "./types";
|
||||||
|
|
||||||
export const RoleButtonsPlugin = zeppelinGuildPlugin<RoleButtonsPluginType>()({
|
export const RoleButtonsPlugin = guildPlugin<RoleButtonsPluginType>()({
|
||||||
name: "role_buttons",
|
name: "role_buttons",
|
||||||
info: pluginInfo,
|
|
||||||
showInDocs: true,
|
|
||||||
|
|
||||||
defaultOptions: {
|
defaultOptions: {
|
||||||
config: {
|
config: {
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../../types";
|
||||||
import { trimPluginDescription } from "../../utils";
|
import { trimPluginDescription } from "../../utils";
|
||||||
import { ZeppelinGuildPluginBlueprint } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { zRoleButtonsConfig } from "./types";
|
import { zRoleButtonsConfig } from "./types";
|
||||||
|
|
||||||
export const pluginInfo: ZeppelinGuildPluginBlueprint["info"] = {
|
export const roleButtonsPluginInfo: ZeppelinPluginInfo = {
|
||||||
|
showInDocs: true,
|
||||||
prettyName: "Role buttons",
|
prettyName: "Role buttons",
|
||||||
description: trimPluginDescription(`
|
description: trimPluginDescription(`
|
||||||
Allow users to pick roles by clicking on buttons
|
Allow users to pick roles by clicking on buttons
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
import { guildPlugin } from "knub";
|
||||||
import { GuildRoleQueue } from "../../data/GuildRoleQueue";
|
import { GuildRoleQueue } from "../../data/GuildRoleQueue";
|
||||||
import { mapToPublicFn } from "../../pluginUtils";
|
import { mapToPublicFn } from "../../pluginUtils";
|
||||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { addPriorityRole } from "./functions/addPriorityRole";
|
import { addPriorityRole } from "./functions/addPriorityRole";
|
||||||
import { addRole } from "./functions/addRole";
|
import { addRole } from "./functions/addRole";
|
||||||
import { removePriorityRole } from "./functions/removePriorityRole";
|
import { removePriorityRole } from "./functions/removePriorityRole";
|
||||||
|
@ -9,9 +9,8 @@ import { removeRole } from "./functions/removeRole";
|
||||||
import { runRoleAssignmentLoop } from "./functions/runRoleAssignmentLoop";
|
import { runRoleAssignmentLoop } from "./functions/runRoleAssignmentLoop";
|
||||||
import { RoleManagerPluginType, zRoleManagerConfig } from "./types";
|
import { RoleManagerPluginType, zRoleManagerConfig } from "./types";
|
||||||
|
|
||||||
export const RoleManagerPlugin = zeppelinGuildPlugin<RoleManagerPluginType>()({
|
export const RoleManagerPlugin = guildPlugin<RoleManagerPluginType>()({
|
||||||
name: "role_manager",
|
name: "role_manager",
|
||||||
showInDocs: false,
|
|
||||||
|
|
||||||
dependencies: () => [LogsPlugin],
|
dependencies: () => [LogsPlugin],
|
||||||
configParser: (input) => zRoleManagerConfig.parse(input),
|
configParser: (input) => zRoleManagerConfig.parse(input),
|
||||||
|
|
6
backend/src/plugins/RoleManager/info.ts
Normal file
6
backend/src/plugins/RoleManager/info.ts
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../../types";
|
||||||
|
|
||||||
|
export const roleManagerPluginInfo: ZeppelinPluginInfo = {
|
||||||
|
prettyName: "Role manager",
|
||||||
|
showInDocs: false,
|
||||||
|
};
|
|
@ -1,9 +1,7 @@
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions, guildPlugin } from "knub";
|
||||||
import { GuildLogs } from "../../data/GuildLogs";
|
import { GuildLogs } from "../../data/GuildLogs";
|
||||||
import { trimPluginDescription } from "../../utils";
|
|
||||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||||
import { RoleManagerPlugin } from "../RoleManager/RoleManagerPlugin";
|
import { RoleManagerPlugin } from "../RoleManager/RoleManagerPlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { AddRoleCmd } from "./commands/AddRoleCmd";
|
import { AddRoleCmd } from "./commands/AddRoleCmd";
|
||||||
import { MassAddRoleCmd } from "./commands/MassAddRoleCmd";
|
import { MassAddRoleCmd } from "./commands/MassAddRoleCmd";
|
||||||
import { MassRemoveRoleCmd } from "./commands/MassRemoveRoleCmd";
|
import { MassRemoveRoleCmd } from "./commands/MassRemoveRoleCmd";
|
||||||
|
@ -32,16 +30,8 @@ const defaultOptions: PluginOptions<RolesPluginType> = {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const RolesPlugin = zeppelinGuildPlugin<RolesPluginType>()({
|
export const RolesPlugin = guildPlugin<RolesPluginType>()({
|
||||||
name: "roles",
|
name: "roles",
|
||||||
showInDocs: true,
|
|
||||||
info: {
|
|
||||||
prettyName: "Roles",
|
|
||||||
description: trimPluginDescription(`
|
|
||||||
Enables authorised users to add and remove whitelisted roles with a command.
|
|
||||||
`),
|
|
||||||
configSchema: zRolesConfig,
|
|
||||||
},
|
|
||||||
|
|
||||||
dependencies: () => [LogsPlugin, RoleManagerPlugin],
|
dependencies: () => [LogsPlugin, RoleManagerPlugin],
|
||||||
configParser: (input) => zRolesConfig.parse(input),
|
configParser: (input) => zRolesConfig.parse(input),
|
||||||
|
|
12
backend/src/plugins/Roles/info.ts
Normal file
12
backend/src/plugins/Roles/info.ts
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../../types";
|
||||||
|
import { trimPluginDescription } from "../../utils";
|
||||||
|
import { zRolesConfig } from "./types";
|
||||||
|
|
||||||
|
export const rolesPluginInfo: ZeppelinPluginInfo = {
|
||||||
|
showInDocs: true,
|
||||||
|
prettyName: "Roles",
|
||||||
|
description: trimPluginDescription(`
|
||||||
|
Enables authorised users to add and remove whitelisted roles with a command.
|
||||||
|
`),
|
||||||
|
configSchema: zRolesConfig,
|
||||||
|
};
|
|
@ -1,6 +1,4 @@
|
||||||
import { CooldownManager, PluginOptions } from "knub";
|
import { CooldownManager, PluginOptions, guildPlugin } from "knub";
|
||||||
import { trimPluginDescription } from "../../utils";
|
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { RoleAddCmd } from "./commands/RoleAddCmd";
|
import { RoleAddCmd } from "./commands/RoleAddCmd";
|
||||||
import { RoleHelpCmd } from "./commands/RoleHelpCmd";
|
import { RoleHelpCmd } from "./commands/RoleHelpCmd";
|
||||||
import { RoleRemoveCmd } from "./commands/RoleRemoveCmd";
|
import { RoleRemoveCmd } from "./commands/RoleRemoveCmd";
|
||||||
|
@ -13,60 +11,8 @@ const defaultOptions: PluginOptions<SelfGrantableRolesPluginType> = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const SelfGrantableRolesPlugin = zeppelinGuildPlugin<SelfGrantableRolesPluginType>()({
|
export const SelfGrantableRolesPlugin = guildPlugin<SelfGrantableRolesPluginType>()({
|
||||||
name: "self_grantable_roles",
|
name: "self_grantable_roles",
|
||||||
showInDocs: true,
|
|
||||||
|
|
||||||
info: {
|
|
||||||
prettyName: "Self-grantable roles",
|
|
||||||
description: trimPluginDescription(`
|
|
||||||
Allows users to grant themselves roles via a command
|
|
||||||
`),
|
|
||||||
configurationGuide: trimPluginDescription(`
|
|
||||||
### Basic configuration
|
|
||||||
In this example, users can add themselves platform roles on the channel 473087035574321152 by using the
|
|
||||||
\`!role\` command. For example, \`!role pc ps4\` to add both the "pc" and "ps4" roles as specified below.
|
|
||||||
|
|
||||||
~~~yml
|
|
||||||
self_grantable_roles:
|
|
||||||
config:
|
|
||||||
entries:
|
|
||||||
basic:
|
|
||||||
roles:
|
|
||||||
"543184300250759188": ["pc", "computer"]
|
|
||||||
"534710505915547658": ["ps4", "ps", "playstation"]
|
|
||||||
"473085927053590538": ["xbox", "xb1", "xb"]
|
|
||||||
overrides:
|
|
||||||
- channel: "473087035574321152"
|
|
||||||
config:
|
|
||||||
entries:
|
|
||||||
basic:
|
|
||||||
can_use: true
|
|
||||||
~~~
|
|
||||||
|
|
||||||
### Maximum number of roles
|
|
||||||
This is identical to the basic example above, but users can only choose 1 role.
|
|
||||||
|
|
||||||
~~~yml
|
|
||||||
self_grantable_roles:
|
|
||||||
config:
|
|
||||||
entries:
|
|
||||||
basic:
|
|
||||||
roles:
|
|
||||||
"543184300250759188": ["pc", "computer"]
|
|
||||||
"534710505915547658": ["ps4", "ps", "playstation"]
|
|
||||||
"473085927053590538": ["xbox", "xb1", "xb"]
|
|
||||||
max_roles: 1
|
|
||||||
overrides:
|
|
||||||
- channel: "473087035574321152"
|
|
||||||
config:
|
|
||||||
entries:
|
|
||||||
basic:
|
|
||||||
can_use: true
|
|
||||||
~~~
|
|
||||||
`),
|
|
||||||
configSchema: zSelfGrantableRolesConfig,
|
|
||||||
},
|
|
||||||
|
|
||||||
configParser: (input) => zSelfGrantableRolesConfig.parse(input),
|
configParser: (input) => zSelfGrantableRolesConfig.parse(input),
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
|
|
55
backend/src/plugins/SelfGrantableRoles/info.ts
Normal file
55
backend/src/plugins/SelfGrantableRoles/info.ts
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../../types";
|
||||||
|
import { trimPluginDescription } from "../../utils";
|
||||||
|
import { zSelfGrantableRolesConfig } from "./types";
|
||||||
|
|
||||||
|
export const selfGrantableRolesPluginInfo: ZeppelinPluginInfo = {
|
||||||
|
showInDocs: true,
|
||||||
|
prettyName: "Self-grantable roles",
|
||||||
|
description: trimPluginDescription(`
|
||||||
|
Allows users to grant themselves roles via a command
|
||||||
|
`),
|
||||||
|
configurationGuide: trimPluginDescription(`
|
||||||
|
### Basic configuration
|
||||||
|
In this example, users can add themselves platform roles on the channel 473087035574321152 by using the
|
||||||
|
\`!role\` command. For example, \`!role pc ps4\` to add both the "pc" and "ps4" roles as specified below.
|
||||||
|
|
||||||
|
~~~yml
|
||||||
|
self_grantable_roles:
|
||||||
|
config:
|
||||||
|
entries:
|
||||||
|
basic:
|
||||||
|
roles:
|
||||||
|
"543184300250759188": ["pc", "computer"]
|
||||||
|
"534710505915547658": ["ps4", "ps", "playstation"]
|
||||||
|
"473085927053590538": ["xbox", "xb1", "xb"]
|
||||||
|
overrides:
|
||||||
|
- channel: "473087035574321152"
|
||||||
|
config:
|
||||||
|
entries:
|
||||||
|
basic:
|
||||||
|
can_use: true
|
||||||
|
~~~
|
||||||
|
|
||||||
|
### Maximum number of roles
|
||||||
|
This is identical to the basic example above, but users can only choose 1 role.
|
||||||
|
|
||||||
|
~~~yml
|
||||||
|
self_grantable_roles:
|
||||||
|
config:
|
||||||
|
entries:
|
||||||
|
basic:
|
||||||
|
roles:
|
||||||
|
"543184300250759188": ["pc", "computer"]
|
||||||
|
"534710505915547658": ["ps4", "ps", "playstation"]
|
||||||
|
"473085927053590538": ["xbox", "xb1", "xb"]
|
||||||
|
max_roles: 1
|
||||||
|
overrides:
|
||||||
|
- channel: "473087035574321152"
|
||||||
|
config:
|
||||||
|
entries:
|
||||||
|
basic:
|
||||||
|
can_use: true
|
||||||
|
~~~
|
||||||
|
`),
|
||||||
|
configSchema: zSelfGrantableRolesConfig,
|
||||||
|
};
|
|
@ -1,10 +1,9 @@
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions, guildPlugin } from "knub";
|
||||||
import { GuildLogs } from "../../data/GuildLogs";
|
import { GuildLogs } from "../../data/GuildLogs";
|
||||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||||
import { GuildSlowmodes } from "../../data/GuildSlowmodes";
|
import { GuildSlowmodes } from "../../data/GuildSlowmodes";
|
||||||
import { SECONDS } from "../../utils";
|
import { SECONDS } from "../../utils";
|
||||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { SlowmodeClearCmd } from "./commands/SlowmodeClearCmd";
|
import { SlowmodeClearCmd } from "./commands/SlowmodeClearCmd";
|
||||||
import { SlowmodeDisableCmd } from "./commands/SlowmodeDisableCmd";
|
import { SlowmodeDisableCmd } from "./commands/SlowmodeDisableCmd";
|
||||||
import { SlowmodeGetCmd } from "./commands/SlowmodeGetCmd";
|
import { SlowmodeGetCmd } from "./commands/SlowmodeGetCmd";
|
||||||
|
@ -35,13 +34,8 @@ const defaultOptions: PluginOptions<SlowmodePluginType> = {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const SlowmodePlugin = zeppelinGuildPlugin<SlowmodePluginType>()({
|
export const SlowmodePlugin = guildPlugin<SlowmodePluginType>()({
|
||||||
name: "slowmode",
|
name: "slowmode",
|
||||||
showInDocs: true,
|
|
||||||
info: {
|
|
||||||
prettyName: "Slowmode",
|
|
||||||
configSchema: zSlowmodeConfig,
|
|
||||||
},
|
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
dependencies: () => [
|
dependencies: () => [
|
||||||
|
|
8
backend/src/plugins/Slowmode/info.ts
Normal file
8
backend/src/plugins/Slowmode/info.ts
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../../types";
|
||||||
|
import { zSlowmodeConfig } from "./types";
|
||||||
|
|
||||||
|
export const slowmodePluginInfo: ZeppelinPluginInfo = {
|
||||||
|
showInDocs: true,
|
||||||
|
prettyName: "Slowmode",
|
||||||
|
configSchema: zSlowmodeConfig,
|
||||||
|
};
|
|
@ -1,11 +1,9 @@
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions, guildPlugin } from "knub";
|
||||||
import { GuildArchives } from "../../data/GuildArchives";
|
import { GuildArchives } from "../../data/GuildArchives";
|
||||||
import { GuildLogs } from "../../data/GuildLogs";
|
import { GuildLogs } from "../../data/GuildLogs";
|
||||||
import { GuildMutes } from "../../data/GuildMutes";
|
import { GuildMutes } from "../../data/GuildMutes";
|
||||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||||
import { trimPluginDescription } from "../../utils";
|
|
||||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { SpamVoiceStateUpdateEvt } from "./events/SpamVoiceEvt";
|
import { SpamVoiceStateUpdateEvt } from "./events/SpamVoiceEvt";
|
||||||
import { SpamPluginType, zSpamConfig } from "./types";
|
import { SpamPluginType, zSpamConfig } from "./types";
|
||||||
import { clearOldRecentActions } from "./util/clearOldRecentActions";
|
import { clearOldRecentActions } from "./util/clearOldRecentActions";
|
||||||
|
@ -42,18 +40,8 @@ const defaultOptions: PluginOptions<SpamPluginType> = {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const SpamPlugin = zeppelinGuildPlugin<SpamPluginType>()({
|
export const SpamPlugin = guildPlugin<SpamPluginType>()({
|
||||||
name: "spam",
|
name: "spam",
|
||||||
showInDocs: true,
|
|
||||||
info: {
|
|
||||||
prettyName: "Spam protection",
|
|
||||||
description: trimPluginDescription(`
|
|
||||||
Basic spam detection and auto-muting.
|
|
||||||
For more advanced spam filtering, check out the Automod plugin!
|
|
||||||
`),
|
|
||||||
legacy: true,
|
|
||||||
configSchema: zSpamConfig,
|
|
||||||
},
|
|
||||||
|
|
||||||
dependencies: () => [LogsPlugin],
|
dependencies: () => [LogsPlugin],
|
||||||
configParser: (input) => zSpamConfig.parse(input),
|
configParser: (input) => zSpamConfig.parse(input),
|
||||||
|
|
14
backend/src/plugins/Spam/info.ts
Normal file
14
backend/src/plugins/Spam/info.ts
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../../types";
|
||||||
|
import { trimPluginDescription } from "../../utils";
|
||||||
|
import { zSpamConfig } from "./types";
|
||||||
|
|
||||||
|
export const spamPluginInfo: ZeppelinPluginInfo = {
|
||||||
|
showInDocs: true,
|
||||||
|
prettyName: "Spam protection",
|
||||||
|
description: trimPluginDescription(`
|
||||||
|
Basic spam detection and auto-muting.
|
||||||
|
For more advanced spam filtering, check out the Automod plugin!
|
||||||
|
`),
|
||||||
|
legacy: true,
|
||||||
|
configSchema: zSpamConfig,
|
||||||
|
};
|
|
@ -1,9 +1,7 @@
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions, guildPlugin } from "knub";
|
||||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||||
import { GuildStarboardMessages } from "../../data/GuildStarboardMessages";
|
import { GuildStarboardMessages } from "../../data/GuildStarboardMessages";
|
||||||
import { GuildStarboardReactions } from "../../data/GuildStarboardReactions";
|
import { GuildStarboardReactions } from "../../data/GuildStarboardReactions";
|
||||||
import { trimPluginDescription } from "../../utils";
|
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { MigratePinsCmd } from "./commands/MigratePinsCmd";
|
import { MigratePinsCmd } from "./commands/MigratePinsCmd";
|
||||||
import { StarboardReactionAddEvt } from "./events/StarboardReactionAddEvt";
|
import { StarboardReactionAddEvt } from "./events/StarboardReactionAddEvt";
|
||||||
import { StarboardReactionRemoveAllEvt, StarboardReactionRemoveEvt } from "./events/StarboardReactionRemoveEvts";
|
import { StarboardReactionRemoveAllEvt, StarboardReactionRemoveEvt } from "./events/StarboardReactionRemoveEvts";
|
||||||
|
@ -26,101 +24,8 @@ const defaultOptions: PluginOptions<StarboardPluginType> = {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const StarboardPlugin = zeppelinGuildPlugin<StarboardPluginType>()({
|
export const StarboardPlugin = guildPlugin<StarboardPluginType>()({
|
||||||
name: "starboard",
|
name: "starboard",
|
||||||
showInDocs: true,
|
|
||||||
|
|
||||||
info: {
|
|
||||||
prettyName: "Starboard",
|
|
||||||
description: trimPluginDescription(`
|
|
||||||
This plugin allows you to set up starboards on your server. Starboards are like user voted pins where messages with enough reactions get immortalized on a "starboard" channel.
|
|
||||||
`),
|
|
||||||
configurationGuide: trimPluginDescription(`
|
|
||||||
### Note on emojis
|
|
||||||
To specify emoji in the config, you need to use the emoji's "raw form".
|
|
||||||
To obtain this, post the emoji with a backslash in front of it.
|
|
||||||
|
|
||||||
- Example with a default emoji: ":star:" => "⭐"
|
|
||||||
- Example with a custom emoji: ":mrvnSmile:" => "<:mrvnSmile:543000534102310933>"
|
|
||||||
|
|
||||||
### Basic starboard
|
|
||||||
Any message on the server that gets 5 star reactions will be posted into the starboard channel (604342689038729226).
|
|
||||||
|
|
||||||
~~~yml
|
|
||||||
starboard:
|
|
||||||
config:
|
|
||||||
boards:
|
|
||||||
basic:
|
|
||||||
channel_id: "604342689038729226"
|
|
||||||
stars_required: 5
|
|
||||||
~~~
|
|
||||||
|
|
||||||
### Basic starboard with custom color
|
|
||||||
Any message on the server that gets 5 star reactions will be posted into the starboard channel (604342689038729226), with the given color (0x87CEEB).
|
|
||||||
|
|
||||||
~~~yml
|
|
||||||
starboard:
|
|
||||||
config:
|
|
||||||
boards:
|
|
||||||
basic:
|
|
||||||
channel_id: "604342689038729226"
|
|
||||||
stars_required: 5
|
|
||||||
color: 0x87CEEB
|
|
||||||
~~~
|
|
||||||
|
|
||||||
### Custom star emoji
|
|
||||||
This is identical to the basic starboard above, but accepts two emoji: the regular star and a custom :mrvnSmile: emoji
|
|
||||||
|
|
||||||
~~~yml
|
|
||||||
starboard:
|
|
||||||
config:
|
|
||||||
boards:
|
|
||||||
basic:
|
|
||||||
channel_id: "604342689038729226"
|
|
||||||
star_emoji: ["⭐", "<:mrvnSmile:543000534102310933>"]
|
|
||||||
stars_required: 5
|
|
||||||
~~~
|
|
||||||
|
|
||||||
### Limit starboard to a specific channel
|
|
||||||
This is identical to the basic starboard above, but only works from a specific channel (473087035574321152).
|
|
||||||
|
|
||||||
~~~yml
|
|
||||||
starboard:
|
|
||||||
config:
|
|
||||||
boards:
|
|
||||||
basic:
|
|
||||||
enabled: false # The starboard starts disabled and is then enabled in a channel override below
|
|
||||||
channel_id: "604342689038729226"
|
|
||||||
stars_required: 5
|
|
||||||
overrides:
|
|
||||||
- channel: "473087035574321152"
|
|
||||||
config:
|
|
||||||
boards:
|
|
||||||
basic:
|
|
||||||
enabled: true
|
|
||||||
~~~
|
|
||||||
|
|
||||||
### Limit starboard to a specific level (and above)
|
|
||||||
This is identical to the basic starboard above, but only works for a specific level (>=50).
|
|
||||||
|
|
||||||
~~~yml
|
|
||||||
starboard:
|
|
||||||
config:
|
|
||||||
boards:
|
|
||||||
levelonly:
|
|
||||||
enabled: false # The starboard starts disabled and is then enabled in a level override below
|
|
||||||
channel_id: "604342689038729226"
|
|
||||||
stars_required: 1
|
|
||||||
overrides:
|
|
||||||
- level: ">=50"
|
|
||||||
config:
|
|
||||||
boards:
|
|
||||||
levelonly:
|
|
||||||
enabled: true
|
|
||||||
~~~
|
|
||||||
`),
|
|
||||||
configSchema: zStarboardConfig,
|
|
||||||
},
|
|
||||||
|
|
||||||
configParser: (input) => zStarboardConfig.parse(input),
|
configParser: (input) => zStarboardConfig.parse(input),
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
|
|
96
backend/src/plugins/Starboard/info.ts
Normal file
96
backend/src/plugins/Starboard/info.ts
Normal file
|
@ -0,0 +1,96 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../../types";
|
||||||
|
import { trimPluginDescription } from "../../utils";
|
||||||
|
import { zStarboardConfig } from "./types";
|
||||||
|
|
||||||
|
export const starboardPluginInfo: ZeppelinPluginInfo = {
|
||||||
|
showInDocs: true,
|
||||||
|
prettyName: "Starboard",
|
||||||
|
description: trimPluginDescription(`
|
||||||
|
This plugin allows you to set up starboards on your server. Starboards are like user voted pins where messages with enough reactions get immortalized on a "starboard" channel.
|
||||||
|
`),
|
||||||
|
configurationGuide: trimPluginDescription(`
|
||||||
|
### Note on emojis
|
||||||
|
To specify emoji in the config, you need to use the emoji's "raw form".
|
||||||
|
To obtain this, post the emoji with a backslash in front of it.
|
||||||
|
|
||||||
|
- Example with a default emoji: ":star:" => "⭐"
|
||||||
|
- Example with a custom emoji: ":mrvnSmile:" => "<:mrvnSmile:543000534102310933>"
|
||||||
|
|
||||||
|
### Basic starboard
|
||||||
|
Any message on the server that gets 5 star reactions will be posted into the starboard channel (604342689038729226).
|
||||||
|
|
||||||
|
~~~yml
|
||||||
|
starboard:
|
||||||
|
config:
|
||||||
|
boards:
|
||||||
|
basic:
|
||||||
|
channel_id: "604342689038729226"
|
||||||
|
stars_required: 5
|
||||||
|
~~~
|
||||||
|
|
||||||
|
### Basic starboard with custom color
|
||||||
|
Any message on the server that gets 5 star reactions will be posted into the starboard channel (604342689038729226), with the given color (0x87CEEB).
|
||||||
|
|
||||||
|
~~~yml
|
||||||
|
starboard:
|
||||||
|
config:
|
||||||
|
boards:
|
||||||
|
basic:
|
||||||
|
channel_id: "604342689038729226"
|
||||||
|
stars_required: 5
|
||||||
|
color: 0x87CEEB
|
||||||
|
~~~
|
||||||
|
|
||||||
|
### Custom star emoji
|
||||||
|
This is identical to the basic starboard above, but accepts two emoji: the regular star and a custom :mrvnSmile: emoji
|
||||||
|
|
||||||
|
~~~yml
|
||||||
|
starboard:
|
||||||
|
config:
|
||||||
|
boards:
|
||||||
|
basic:
|
||||||
|
channel_id: "604342689038729226"
|
||||||
|
star_emoji: ["⭐", "<:mrvnSmile:543000534102310933>"]
|
||||||
|
stars_required: 5
|
||||||
|
~~~
|
||||||
|
|
||||||
|
### Limit starboard to a specific channel
|
||||||
|
This is identical to the basic starboard above, but only works from a specific channel (473087035574321152).
|
||||||
|
|
||||||
|
~~~yml
|
||||||
|
starboard:
|
||||||
|
config:
|
||||||
|
boards:
|
||||||
|
basic:
|
||||||
|
enabled: false # The starboard starts disabled and is then enabled in a channel override below
|
||||||
|
channel_id: "604342689038729226"
|
||||||
|
stars_required: 5
|
||||||
|
overrides:
|
||||||
|
- channel: "473087035574321152"
|
||||||
|
config:
|
||||||
|
boards:
|
||||||
|
basic:
|
||||||
|
enabled: true
|
||||||
|
~~~
|
||||||
|
|
||||||
|
### Limit starboard to a specific level (and above)
|
||||||
|
This is identical to the basic starboard above, but only works for a specific level (>=50).
|
||||||
|
|
||||||
|
~~~yml
|
||||||
|
starboard:
|
||||||
|
config:
|
||||||
|
boards:
|
||||||
|
levelonly:
|
||||||
|
enabled: false # The starboard starts disabled and is then enabled in a level override below
|
||||||
|
channel_id: "604342689038729226"
|
||||||
|
stars_required: 1
|
||||||
|
overrides:
|
||||||
|
- level: ">=50"
|
||||||
|
config:
|
||||||
|
boards:
|
||||||
|
levelonly:
|
||||||
|
enabled: true
|
||||||
|
~~~
|
||||||
|
`),
|
||||||
|
configSchema: zStarboardConfig,
|
||||||
|
};
|
|
@ -1,23 +1,20 @@
|
||||||
import { Snowflake } from "discord.js";
|
import { Snowflake } from "discord.js";
|
||||||
import humanizeDuration from "humanize-duration";
|
import humanizeDuration from "humanize-duration";
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions, guildPlugin } from "knub";
|
||||||
import moment from "moment-timezone";
|
import moment from "moment-timezone";
|
||||||
import { GuildArchives } from "../../data/GuildArchives";
|
import { GuildArchives } from "../../data/GuildArchives";
|
||||||
import { GuildLogs } from "../../data/GuildLogs";
|
import { GuildLogs } from "../../data/GuildLogs";
|
||||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||||
import { GuildTags } from "../../data/GuildTags";
|
import { GuildTags } from "../../data/GuildTags";
|
||||||
import { mapToPublicFn } from "../../pluginUtils";
|
import { mapToPublicFn } from "../../pluginUtils";
|
||||||
import { convertDelayStringToMS, trimPluginDescription } from "../../utils";
|
import { convertDelayStringToMS } from "../../utils";
|
||||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||||
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { TagCreateCmd } from "./commands/TagCreateCmd";
|
import { TagCreateCmd } from "./commands/TagCreateCmd";
|
||||||
import { TagDeleteCmd } from "./commands/TagDeleteCmd";
|
import { TagDeleteCmd } from "./commands/TagDeleteCmd";
|
||||||
import { TagEvalCmd } from "./commands/TagEvalCmd";
|
import { TagEvalCmd } from "./commands/TagEvalCmd";
|
||||||
import { TagListCmd } from "./commands/TagListCmd";
|
import { TagListCmd } from "./commands/TagListCmd";
|
||||||
import { TagSourceCmd } from "./commands/TagSourceCmd";
|
import { TagSourceCmd } from "./commands/TagSourceCmd";
|
||||||
import { generateTemplateMarkdown } from "./docs";
|
|
||||||
import { TemplateFunctions } from "./templateFunctions";
|
|
||||||
import { TagsPluginType, zTagsConfig } from "./types";
|
import { TagsPluginType, zTagsConfig } from "./types";
|
||||||
import { findTagByName } from "./util/findTagByName";
|
import { findTagByName } from "./util/findTagByName";
|
||||||
import { onMessageCreate } from "./util/onMessageCreate";
|
import { onMessageCreate } from "./util/onMessageCreate";
|
||||||
|
@ -54,24 +51,8 @@ const defaultOptions: PluginOptions<TagsPluginType> = {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const TagsPlugin = zeppelinGuildPlugin<TagsPluginType>()({
|
export const TagsPlugin = guildPlugin<TagsPluginType>()({
|
||||||
name: "tags",
|
name: "tags",
|
||||||
showInDocs: true,
|
|
||||||
info: {
|
|
||||||
prettyName: "Tags",
|
|
||||||
description: "Tags are a way to store and reuse information.",
|
|
||||||
configurationGuide: trimPluginDescription(`
|
|
||||||
### Template Functions
|
|
||||||
You can use template functions in your tags. These functions are called when the tag is rendered.
|
|
||||||
You can use these functions to render dynamic content, or to access information from the message and/or user calling the tag.
|
|
||||||
You use them by adding a \`{}\` on your tag.
|
|
||||||
|
|
||||||
Here are the functions you can use in your tags:
|
|
||||||
|
|
||||||
${generateTemplateMarkdown(TemplateFunctions)}
|
|
||||||
`),
|
|
||||||
configSchema: zTagsConfig,
|
|
||||||
},
|
|
||||||
|
|
||||||
dependencies: () => [LogsPlugin],
|
dependencies: () => [LogsPlugin],
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
import { trimPluginDescription } from "../../utils";
|
|
||||||
import { TemplateFunction } from "./types";
|
|
||||||
|
|
||||||
export function generateTemplateMarkdown(definitions: TemplateFunction[]): string {
|
|
||||||
return definitions
|
|
||||||
.map((def) => {
|
|
||||||
const usage = def.signature ?? `(${def.arguments.join(", ")})`;
|
|
||||||
const examples = def.examples?.map((ex) => `> \`{${ex}}\``).join("\n") ?? null;
|
|
||||||
return trimPluginDescription(`
|
|
||||||
## ${def.name}
|
|
||||||
**${def.description}**\n
|
|
||||||
__Usage__: \`{${def.name}${usage}}\`\n
|
|
||||||
${examples ? `__Examples__:\n${examples}` : ""}\n\n
|
|
||||||
`);
|
|
||||||
})
|
|
||||||
.join("\n\n");
|
|
||||||
}
|
|
36
backend/src/plugins/Tags/info.ts
Normal file
36
backend/src/plugins/Tags/info.ts
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../../types";
|
||||||
|
import { trimPluginDescription } from "../../utils";
|
||||||
|
import { TemplateFunctions } from "./templateFunctions";
|
||||||
|
import { TemplateFunction, zTagsConfig } from "./types";
|
||||||
|
|
||||||
|
export const tagsPluginInfo: ZeppelinPluginInfo = {
|
||||||
|
showInDocs: true,
|
||||||
|
prettyName: "Tags",
|
||||||
|
description: "Tags are a way to store and reuse information.",
|
||||||
|
configurationGuide: trimPluginDescription(`
|
||||||
|
### Template Functions
|
||||||
|
You can use template functions in your tags. These functions are called when the tag is rendered.
|
||||||
|
You can use these functions to render dynamic content, or to access information from the message and/or user calling the tag.
|
||||||
|
You use them by adding a \`{}\` on your tag.
|
||||||
|
|
||||||
|
Here are the functions you can use in your tags:
|
||||||
|
|
||||||
|
${generateTemplateMarkdown(TemplateFunctions)}
|
||||||
|
`),
|
||||||
|
configSchema: zTagsConfig,
|
||||||
|
};
|
||||||
|
|
||||||
|
function generateTemplateMarkdown(definitions: TemplateFunction[]): string {
|
||||||
|
return definitions
|
||||||
|
.map((def) => {
|
||||||
|
const usage = def.signature ?? `(${def.arguments.join(", ")})`;
|
||||||
|
const examples = def.examples?.map((ex) => `> \`{${ex}}\``).join("\n") ?? null;
|
||||||
|
return trimPluginDescription(`
|
||||||
|
## ${def.name}
|
||||||
|
**${def.description}**\n
|
||||||
|
__Usage__: \`{${def.name}${usage}}\`\n
|
||||||
|
${examples ? `__Examples__:\n${examples}` : ""}\n\n
|
||||||
|
`);
|
||||||
|
})
|
||||||
|
.join("\n\n");
|
||||||
|
}
|
|
@ -1,8 +1,6 @@
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions, guildPlugin } from "knub";
|
||||||
import { GuildMemberTimezones } from "../../data/GuildMemberTimezones";
|
import { GuildMemberTimezones } from "../../data/GuildMemberTimezones";
|
||||||
import { mapToPublicFn } from "../../pluginUtils";
|
import { mapToPublicFn } from "../../pluginUtils";
|
||||||
import { trimPluginDescription } from "../../utils";
|
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { ResetTimezoneCmd } from "./commands/ResetTimezoneCmd";
|
import { ResetTimezoneCmd } from "./commands/ResetTimezoneCmd";
|
||||||
import { SetTimezoneCmd } from "./commands/SetTimezoneCmd";
|
import { SetTimezoneCmd } from "./commands/SetTimezoneCmd";
|
||||||
import { ViewTimezoneCmd } from "./commands/ViewTimezoneCmd";
|
import { ViewTimezoneCmd } from "./commands/ViewTimezoneCmd";
|
||||||
|
@ -31,16 +29,8 @@ const defaultOptions: PluginOptions<TimeAndDatePluginType> = {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const TimeAndDatePlugin = zeppelinGuildPlugin<TimeAndDatePluginType>()({
|
export const TimeAndDatePlugin = guildPlugin<TimeAndDatePluginType>()({
|
||||||
name: "time_and_date",
|
name: "time_and_date",
|
||||||
showInDocs: true,
|
|
||||||
info: {
|
|
||||||
prettyName: "Time and date",
|
|
||||||
description: trimPluginDescription(`
|
|
||||||
Allows controlling the displayed time/date formats and timezones
|
|
||||||
`),
|
|
||||||
configSchema: zTimeAndDateConfig,
|
|
||||||
},
|
|
||||||
|
|
||||||
configParser: (input) => zTimeAndDateConfig.parse(input),
|
configParser: (input) => zTimeAndDateConfig.parse(input),
|
||||||
defaultOptions,
|
defaultOptions,
|
||||||
|
|
12
backend/src/plugins/TimeAndDate/info.ts
Normal file
12
backend/src/plugins/TimeAndDate/info.ts
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../../types";
|
||||||
|
import { trimPluginDescription } from "../../utils";
|
||||||
|
import { zTimeAndDateConfig } from "./types";
|
||||||
|
|
||||||
|
export const timeAndDatePluginInfo: ZeppelinPluginInfo = {
|
||||||
|
showInDocs: true,
|
||||||
|
prettyName: "Time and date",
|
||||||
|
description: trimPluginDescription(`
|
||||||
|
Allows controlling the displayed time/date formats and timezones
|
||||||
|
`),
|
||||||
|
configSchema: zTimeAndDateConfig,
|
||||||
|
};
|
|
@ -1,12 +1,11 @@
|
||||||
|
import { guildPlugin } from "knub";
|
||||||
import { Queue } from "../../Queue";
|
import { Queue } from "../../Queue";
|
||||||
import { UsernameHistory } from "../../data/UsernameHistory";
|
import { UsernameHistory } from "../../data/UsernameHistory";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { MessageCreateUpdateUsernameEvt, VoiceChannelJoinUpdateUsernameEvt } from "./events/UpdateUsernameEvts";
|
import { MessageCreateUpdateUsernameEvt, VoiceChannelJoinUpdateUsernameEvt } from "./events/UpdateUsernameEvts";
|
||||||
import { UsernameSaverPluginType, zUsernameSaverConfig } from "./types";
|
import { UsernameSaverPluginType, zUsernameSaverConfig } from "./types";
|
||||||
|
|
||||||
export const UsernameSaverPlugin = zeppelinGuildPlugin<UsernameSaverPluginType>()({
|
export const UsernameSaverPlugin = guildPlugin<UsernameSaverPluginType>()({
|
||||||
name: "username_saver",
|
name: "username_saver",
|
||||||
showInDocs: false,
|
|
||||||
|
|
||||||
configParser: (input) => zUsernameSaverConfig.parse(input),
|
configParser: (input) => zUsernameSaverConfig.parse(input),
|
||||||
|
|
||||||
|
|
6
backend/src/plugins/UsernameSaver/info.ts
Normal file
6
backend/src/plugins/UsernameSaver/info.ts
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../../types";
|
||||||
|
|
||||||
|
export const usernameSaverPluginInfo: ZeppelinPluginInfo = {
|
||||||
|
showInDocs: false,
|
||||||
|
prettyName: "Username saver",
|
||||||
|
};
|
|
@ -1,5 +1,5 @@
|
||||||
import { GuildMember, Snowflake } from "discord.js";
|
import { GuildMember, Snowflake } from "discord.js";
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions, guildPlugin } from "knub";
|
||||||
import { GuildArchives } from "../../data/GuildArchives";
|
import { GuildArchives } from "../../data/GuildArchives";
|
||||||
import { GuildCases } from "../../data/GuildCases";
|
import { GuildCases } from "../../data/GuildCases";
|
||||||
import { GuildLogs } from "../../data/GuildLogs";
|
import { GuildLogs } from "../../data/GuildLogs";
|
||||||
|
@ -10,7 +10,6 @@ import { discardRegExpRunner, getRegExpRunner } from "../../regExpRunners";
|
||||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||||
import { ModActionsPlugin } from "../ModActions/ModActionsPlugin";
|
import { ModActionsPlugin } from "../ModActions/ModActionsPlugin";
|
||||||
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { AboutCmd } from "./commands/AboutCmd";
|
import { AboutCmd } from "./commands/AboutCmd";
|
||||||
import { AvatarCmd } from "./commands/AvatarCmd";
|
import { AvatarCmd } from "./commands/AvatarCmd";
|
||||||
import { BanSearchCmd } from "./commands/BanSearchCmd";
|
import { BanSearchCmd } from "./commands/BanSearchCmd";
|
||||||
|
@ -112,13 +111,8 @@ const defaultOptions: PluginOptions<UtilityPluginType> = {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const UtilityPlugin = zeppelinGuildPlugin<UtilityPluginType>()({
|
export const UtilityPlugin = guildPlugin<UtilityPluginType>()({
|
||||||
name: "utility",
|
name: "utility",
|
||||||
showInDocs: true,
|
|
||||||
info: {
|
|
||||||
prettyName: "Utility",
|
|
||||||
configSchema: zUtilityConfig,
|
|
||||||
},
|
|
||||||
|
|
||||||
dependencies: () => [TimeAndDatePlugin, ModActionsPlugin, LogsPlugin],
|
dependencies: () => [TimeAndDatePlugin, ModActionsPlugin, LogsPlugin],
|
||||||
configParser: (input) => zUtilityConfig.parse(input),
|
configParser: (input) => zUtilityConfig.parse(input),
|
||||||
|
|
8
backend/src/plugins/Utility/info.ts
Normal file
8
backend/src/plugins/Utility/info.ts
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../../types";
|
||||||
|
import { zUtilityConfig } from "./types";
|
||||||
|
|
||||||
|
export const utilityPluginInfo: ZeppelinPluginInfo = {
|
||||||
|
showInDocs: true,
|
||||||
|
prettyName: "Utility",
|
||||||
|
configSchema: zUtilityConfig,
|
||||||
|
};
|
|
@ -1,7 +1,6 @@
|
||||||
import { PluginOptions } from "knub";
|
import { PluginOptions, guildPlugin } from "knub";
|
||||||
import { GuildLogs } from "../../data/GuildLogs";
|
import { GuildLogs } from "../../data/GuildLogs";
|
||||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
|
||||||
import { SendWelcomeMessageEvt } from "./events/SendWelcomeMessageEvt";
|
import { SendWelcomeMessageEvt } from "./events/SendWelcomeMessageEvt";
|
||||||
import { WelcomeMessagePluginType, zWelcomeMessageConfig } from "./types";
|
import { WelcomeMessagePluginType, zWelcomeMessageConfig } from "./types";
|
||||||
|
|
||||||
|
@ -13,13 +12,8 @@ const defaultOptions: PluginOptions<WelcomeMessagePluginType> = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const WelcomeMessagePlugin = zeppelinGuildPlugin<WelcomeMessagePluginType>()({
|
export const WelcomeMessagePlugin = guildPlugin<WelcomeMessagePluginType>()({
|
||||||
name: "welcome_message",
|
name: "welcome_message",
|
||||||
showInDocs: true,
|
|
||||||
info: {
|
|
||||||
prettyName: "Welcome message",
|
|
||||||
configSchema: zWelcomeMessageConfig,
|
|
||||||
},
|
|
||||||
|
|
||||||
dependencies: () => [LogsPlugin],
|
dependencies: () => [LogsPlugin],
|
||||||
configParser: (input) => zWelcomeMessageConfig.parse(input),
|
configParser: (input) => zWelcomeMessageConfig.parse(input),
|
||||||
|
|
8
backend/src/plugins/WelcomeMessage/info.ts
Normal file
8
backend/src/plugins/WelcomeMessage/info.ts
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../../types";
|
||||||
|
import { zWelcomeMessageConfig } from "./types";
|
||||||
|
|
||||||
|
export const welcomeMessagePluginInfo: ZeppelinPluginInfo = {
|
||||||
|
showInDocs: true,
|
||||||
|
prettyName: "Welcome message",
|
||||||
|
configSchema: zWelcomeMessageConfig,
|
||||||
|
};
|
|
@ -1,3 +0,0 @@
|
||||||
import { ZeppelinGlobalPluginBlueprint, ZeppelinGuildPluginBlueprint } from "./ZeppelinPluginBlueprint";
|
|
||||||
|
|
||||||
export type ZeppelinPlugin = ZeppelinGuildPluginBlueprint<any> | ZeppelinGlobalPluginBlueprint<any>;
|
|
|
@ -1,75 +0,0 @@
|
||||||
import {
|
|
||||||
BasePluginType,
|
|
||||||
globalPlugin,
|
|
||||||
GlobalPluginBlueprint,
|
|
||||||
GlobalPluginData,
|
|
||||||
guildPlugin,
|
|
||||||
GuildPluginBlueprint,
|
|
||||||
GuildPluginData,
|
|
||||||
} from "knub";
|
|
||||||
import { ZodTypeAny } from "zod";
|
|
||||||
import { TMarkdown } from "../types";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GUILD PLUGINS
|
|
||||||
*/
|
|
||||||
|
|
||||||
export interface ZeppelinGuildPluginBlueprint<TPluginData extends GuildPluginData<any> = GuildPluginData<any>>
|
|
||||||
extends GuildPluginBlueprint<TPluginData> {
|
|
||||||
showInDocs?: boolean;
|
|
||||||
info?: {
|
|
||||||
prettyName: string;
|
|
||||||
description?: TMarkdown;
|
|
||||||
usageGuide?: TMarkdown;
|
|
||||||
configurationGuide?: TMarkdown;
|
|
||||||
legacy?: boolean | string;
|
|
||||||
configSchema?: ZodTypeAny;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export function zeppelinGuildPlugin<TBlueprint extends ZeppelinGuildPluginBlueprint>(blueprint: TBlueprint): TBlueprint;
|
|
||||||
|
|
||||||
export function zeppelinGuildPlugin<TPluginType extends BasePluginType>(): <
|
|
||||||
TBlueprint extends ZeppelinGuildPluginBlueprint<GuildPluginData<TPluginType>>,
|
|
||||||
>(
|
|
||||||
blueprint: TBlueprint,
|
|
||||||
) => TBlueprint;
|
|
||||||
|
|
||||||
export function zeppelinGuildPlugin(...args) {
|
|
||||||
if (args.length) {
|
|
||||||
const blueprint = guildPlugin(
|
|
||||||
...(args as Parameters<typeof guildPlugin>),
|
|
||||||
) as unknown as ZeppelinGuildPluginBlueprint;
|
|
||||||
return blueprint;
|
|
||||||
} else {
|
|
||||||
return zeppelinGuildPlugin as (name, blueprint) => ZeppelinGuildPluginBlueprint;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GLOBAL PLUGINS
|
|
||||||
*/
|
|
||||||
|
|
||||||
export interface ZeppelinGlobalPluginBlueprint<TPluginType extends BasePluginType = BasePluginType>
|
|
||||||
extends GlobalPluginBlueprint<GlobalPluginData<TPluginType>> {}
|
|
||||||
|
|
||||||
export function zeppelinGlobalPlugin<TBlueprint extends ZeppelinGlobalPluginBlueprint>(
|
|
||||||
blueprint: TBlueprint,
|
|
||||||
): TBlueprint;
|
|
||||||
|
|
||||||
export function zeppelinGlobalPlugin<TPluginType extends BasePluginType>(): <
|
|
||||||
TBlueprint extends ZeppelinGlobalPluginBlueprint<TPluginType>,
|
|
||||||
>(
|
|
||||||
blueprint: TBlueprint,
|
|
||||||
) => TBlueprint;
|
|
||||||
|
|
||||||
export function zeppelinGlobalPlugin(...args) {
|
|
||||||
if (args.length) {
|
|
||||||
const blueprint = globalPlugin(
|
|
||||||
...(args as Parameters<typeof globalPlugin>),
|
|
||||||
) as unknown as ZeppelinGlobalPluginBlueprint;
|
|
||||||
return blueprint;
|
|
||||||
} else {
|
|
||||||
return zeppelinGlobalPlugin as (name, blueprint) => ZeppelinGlobalPluginBlueprint;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { GlobalPluginBlueprint, GuildPluginBlueprint } from "knub";
|
||||||
import { AutoDeletePlugin } from "./AutoDelete/AutoDeletePlugin";
|
import { AutoDeletePlugin } from "./AutoDelete/AutoDeletePlugin";
|
||||||
import { AutoReactionsPlugin } from "./AutoReactions/AutoReactionsPlugin";
|
import { AutoReactionsPlugin } from "./AutoReactions/AutoReactionsPlugin";
|
||||||
import { AutomodPlugin } from "./Automod/AutomodPlugin";
|
import { AutomodPlugin } from "./Automod/AutomodPlugin";
|
||||||
|
@ -37,10 +38,9 @@ import { TimeAndDatePlugin } from "./TimeAndDate/TimeAndDatePlugin";
|
||||||
import { UsernameSaverPlugin } from "./UsernameSaver/UsernameSaverPlugin";
|
import { UsernameSaverPlugin } from "./UsernameSaver/UsernameSaverPlugin";
|
||||||
import { UtilityPlugin } from "./Utility/UtilityPlugin";
|
import { UtilityPlugin } from "./Utility/UtilityPlugin";
|
||||||
import { WelcomeMessagePlugin } from "./WelcomeMessage/WelcomeMessagePlugin";
|
import { WelcomeMessagePlugin } from "./WelcomeMessage/WelcomeMessagePlugin";
|
||||||
import { ZeppelinGlobalPluginBlueprint, ZeppelinGuildPluginBlueprint } from "./ZeppelinPluginBlueprint";
|
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
export const guildPlugins: Array<ZeppelinGuildPluginBlueprint<any>> = [
|
export const guildPlugins: Array<GuildPluginBlueprint<any, any>> = [
|
||||||
AutoDeletePlugin,
|
AutoDeletePlugin,
|
||||||
AutoReactionsPlugin,
|
AutoReactionsPlugin,
|
||||||
GuildInfoSaverPlugin,
|
GuildInfoSaverPlugin,
|
||||||
|
@ -81,14 +81,14 @@ export const guildPlugins: Array<ZeppelinGuildPluginBlueprint<any>> = [
|
||||||
];
|
];
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
export const globalPlugins: Array<ZeppelinGlobalPluginBlueprint<any>> = [
|
export const globalPlugins: Array<GlobalPluginBlueprint<any, any>> = [
|
||||||
GuildConfigReloaderPlugin,
|
GuildConfigReloaderPlugin,
|
||||||
BotControlPlugin,
|
BotControlPlugin,
|
||||||
GuildAccessMonitorPlugin,
|
GuildAccessMonitorPlugin,
|
||||||
];
|
];
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
export const baseGuildPlugins: Array<ZeppelinGuildPluginBlueprint<any>> = [
|
export const baseGuildPlugins: Array<GuildPluginBlueprint<any, any>> = [
|
||||||
GuildInfoSaverPlugin,
|
GuildInfoSaverPlugin,
|
||||||
MessageSaverPlugin,
|
MessageSaverPlugin,
|
||||||
NameHistoryPlugin,
|
NameHistoryPlugin,
|
||||||
|
|
109
backend/src/plugins/pluginInfo.ts
Normal file
109
backend/src/plugins/pluginInfo.ts
Normal file
|
@ -0,0 +1,109 @@
|
||||||
|
import { ZeppelinPluginInfo } from "../types";
|
||||||
|
import { AutoDeletePlugin } from "./AutoDelete/AutoDeletePlugin";
|
||||||
|
import { autoDeletePluginInfo } from "./AutoDelete/info";
|
||||||
|
import { AutoReactionsPlugin } from "./AutoReactions/AutoReactionsPlugin";
|
||||||
|
import { autoReactionsInfo } from "./AutoReactions/info";
|
||||||
|
import { AutomodPlugin } from "./Automod/AutomodPlugin";
|
||||||
|
import { automodPluginInfo } from "./Automod/info";
|
||||||
|
import { CasesPlugin } from "./Cases/CasesPlugin";
|
||||||
|
import { casesPluginInfo } from "./Cases/info";
|
||||||
|
import { CensorPlugin } from "./Censor/CensorPlugin";
|
||||||
|
import { censorPluginInfo } from "./Censor/info";
|
||||||
|
import { CompanionChannelsPlugin } from "./CompanionChannels/CompanionChannelsPlugin";
|
||||||
|
import { companionChannelsPluginInfo } from "./CompanionChannels/info";
|
||||||
|
import { ContextMenuPlugin } from "./ContextMenus/ContextMenuPlugin";
|
||||||
|
import { contextMenuPluginInfo } from "./ContextMenus/info";
|
||||||
|
import { CountersPlugin } from "./Counters/CountersPlugin";
|
||||||
|
import { countersPluginInfo } from "./Counters/info";
|
||||||
|
import { CustomEventsPlugin } from "./CustomEvents/CustomEventsPlugin";
|
||||||
|
import { customEventsPluginInfo } from "./CustomEvents/info";
|
||||||
|
import { GuildInfoSaverPlugin } from "./GuildInfoSaver/GuildInfoSaverPlugin";
|
||||||
|
import { guildInfoSaverPluginInfo } from "./GuildInfoSaver/info";
|
||||||
|
import { InternalPosterPlugin } from "./InternalPoster/InternalPosterPlugin";
|
||||||
|
import { internalPosterPluginInfo } from "./InternalPoster/info";
|
||||||
|
import { LocateUserPlugin } from "./LocateUser/LocateUserPlugin";
|
||||||
|
import { locateUserPluginInfo } from "./LocateUser/info";
|
||||||
|
import { LogsPlugin } from "./Logs/LogsPlugin";
|
||||||
|
import { logsPluginInfo } from "./Logs/info";
|
||||||
|
import { MessageSaverPlugin } from "./MessageSaver/MessageSaverPlugin";
|
||||||
|
import { messageSaverPluginInfo } from "./MessageSaver/info";
|
||||||
|
import { ModActionsPlugin } from "./ModActions/ModActionsPlugin";
|
||||||
|
import { modActionsPluginInfo } from "./ModActions/info";
|
||||||
|
import { MutesPlugin } from "./Mutes/MutesPlugin";
|
||||||
|
import { mutesPluginInfo } from "./Mutes/info";
|
||||||
|
import { NameHistoryPlugin } from "./NameHistory/NameHistoryPlugin";
|
||||||
|
import { nameHistoryPluginInfo } from "./NameHistory/info";
|
||||||
|
import { PersistPlugin } from "./Persist/PersistPlugin";
|
||||||
|
import { persistPluginInfo } from "./Persist/info";
|
||||||
|
import { PhishermanPlugin } from "./Phisherman/PhishermanPlugin";
|
||||||
|
import { phishermanPluginInfo } from "./Phisherman/info";
|
||||||
|
import { PingableRolesPlugin } from "./PingableRoles/PingableRolesPlugin";
|
||||||
|
import { pingableRolesPluginInfo } from "./PingableRoles/info";
|
||||||
|
import { PostPlugin } from "./Post/PostPlugin";
|
||||||
|
import { postPluginInfo } from "./Post/info";
|
||||||
|
import { ReactionRolesPlugin } from "./ReactionRoles/ReactionRolesPlugin";
|
||||||
|
import { reactionRolesPluginInfo } from "./ReactionRoles/info";
|
||||||
|
import { RemindersPlugin } from "./Reminders/RemindersPlugin";
|
||||||
|
import { remindersPluginInfo } from "./Reminders/info";
|
||||||
|
import { RoleButtonsPlugin } from "./RoleButtons/RoleButtonsPlugin";
|
||||||
|
import { roleButtonsPluginInfo } from "./RoleButtons/info";
|
||||||
|
import { RoleManagerPlugin } from "./RoleManager/RoleManagerPlugin";
|
||||||
|
import { roleManagerPluginInfo } from "./RoleManager/info";
|
||||||
|
import { RolesPlugin } from "./Roles/RolesPlugin";
|
||||||
|
import { rolesPluginInfo } from "./Roles/info";
|
||||||
|
import { SelfGrantableRolesPlugin } from "./SelfGrantableRoles/SelfGrantableRolesPlugin";
|
||||||
|
import { selfGrantableRolesPluginInfo } from "./SelfGrantableRoles/info";
|
||||||
|
import { SlowmodePlugin } from "./Slowmode/SlowmodePlugin";
|
||||||
|
import { slowmodePluginInfo } from "./Slowmode/info";
|
||||||
|
import { SpamPlugin } from "./Spam/SpamPlugin";
|
||||||
|
import { spamPluginInfo } from "./Spam/info";
|
||||||
|
import { StarboardPlugin } from "./Starboard/StarboardPlugin";
|
||||||
|
import { starboardPluginInfo } from "./Starboard/info";
|
||||||
|
import { TagsPlugin } from "./Tags/TagsPlugin";
|
||||||
|
import { tagsPluginInfo } from "./Tags/info";
|
||||||
|
import { TimeAndDatePlugin } from "./TimeAndDate/TimeAndDatePlugin";
|
||||||
|
import { timeAndDatePluginInfo } from "./TimeAndDate/info";
|
||||||
|
import { UsernameSaverPlugin } from "./UsernameSaver/UsernameSaverPlugin";
|
||||||
|
import { usernameSaverPluginInfo } from "./UsernameSaver/info";
|
||||||
|
import { UtilityPlugin } from "./Utility/UtilityPlugin";
|
||||||
|
import { utilityPluginInfo } from "./Utility/info";
|
||||||
|
import { WelcomeMessagePlugin } from "./WelcomeMessage/WelcomeMessagePlugin";
|
||||||
|
import { welcomeMessagePluginInfo } from "./WelcomeMessage/info";
|
||||||
|
|
||||||
|
export const guildPluginInfo: Record<string, ZeppelinPluginInfo> = {
|
||||||
|
[AutoDeletePlugin.name]: autoDeletePluginInfo,
|
||||||
|
[AutoReactionsPlugin.name]: autoReactionsInfo,
|
||||||
|
[GuildInfoSaverPlugin.name]: guildInfoSaverPluginInfo,
|
||||||
|
[CensorPlugin.name]: censorPluginInfo,
|
||||||
|
[LocateUserPlugin.name]: locateUserPluginInfo,
|
||||||
|
[LogsPlugin.name]: logsPluginInfo,
|
||||||
|
[PersistPlugin.name]: persistPluginInfo,
|
||||||
|
[PingableRolesPlugin.name]: pingableRolesPluginInfo,
|
||||||
|
[PostPlugin.name]: postPluginInfo,
|
||||||
|
[ReactionRolesPlugin.name]: reactionRolesPluginInfo,
|
||||||
|
[MessageSaverPlugin.name]: messageSaverPluginInfo,
|
||||||
|
[ModActionsPlugin.name]: modActionsPluginInfo,
|
||||||
|
[NameHistoryPlugin.name]: nameHistoryPluginInfo,
|
||||||
|
[RemindersPlugin.name]: remindersPluginInfo,
|
||||||
|
[RolesPlugin.name]: rolesPluginInfo,
|
||||||
|
[SelfGrantableRolesPlugin.name]: selfGrantableRolesPluginInfo,
|
||||||
|
[SlowmodePlugin.name]: slowmodePluginInfo,
|
||||||
|
[SpamPlugin.name]: spamPluginInfo,
|
||||||
|
[StarboardPlugin.name]: starboardPluginInfo,
|
||||||
|
[TagsPlugin.name]: tagsPluginInfo,
|
||||||
|
[UsernameSaverPlugin.name]: usernameSaverPluginInfo,
|
||||||
|
[UtilityPlugin.name]: utilityPluginInfo,
|
||||||
|
[WelcomeMessagePlugin.name]: welcomeMessagePluginInfo,
|
||||||
|
[CasesPlugin.name]: casesPluginInfo,
|
||||||
|
[MutesPlugin.name]: mutesPluginInfo,
|
||||||
|
[AutomodPlugin.name]: automodPluginInfo,
|
||||||
|
[CompanionChannelsPlugin.name]: companionChannelsPluginInfo,
|
||||||
|
[CustomEventsPlugin.name]: customEventsPluginInfo,
|
||||||
|
[TimeAndDatePlugin.name]: timeAndDatePluginInfo,
|
||||||
|
[CountersPlugin.name]: countersPluginInfo,
|
||||||
|
[ContextMenuPlugin.name]: contextMenuPluginInfo,
|
||||||
|
[PhishermanPlugin.name]: phishermanPluginInfo,
|
||||||
|
[InternalPosterPlugin.name]: internalPosterPluginInfo,
|
||||||
|
[RoleManagerPlugin.name]: roleManagerPluginInfo,
|
||||||
|
[RoleButtonsPlugin.name]: roleButtonsPluginInfo,
|
||||||
|
};
|
|
@ -1,5 +1,5 @@
|
||||||
import { BaseConfig, Knub } from "knub";
|
import { BaseConfig, Knub } from "knub";
|
||||||
import z from "zod";
|
import z, { ZodTypeAny } from "zod";
|
||||||
import { zSnowflake } from "./utils";
|
import { zSnowflake } from "./utils";
|
||||||
|
|
||||||
export interface ZeppelinGuildConfig extends BaseConfig {
|
export interface ZeppelinGuildConfig extends BaseConfig {
|
||||||
|
@ -34,11 +34,13 @@ export type TZeppelinKnub = Knub;
|
||||||
export type TMarkdown = string;
|
export type TMarkdown = string;
|
||||||
|
|
||||||
export interface ZeppelinPluginInfo {
|
export interface ZeppelinPluginInfo {
|
||||||
|
showInDocs: boolean;
|
||||||
prettyName: string;
|
prettyName: string;
|
||||||
description?: TMarkdown;
|
description?: TMarkdown;
|
||||||
usageGuide?: TMarkdown;
|
usageGuide?: TMarkdown;
|
||||||
configurationGuide?: TMarkdown;
|
configurationGuide?: TMarkdown;
|
||||||
legacy?: boolean;
|
legacy?: boolean;
|
||||||
|
configSchema?: ZodTypeAny;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CommandInfo {
|
export interface CommandInfo {
|
||||||
|
|
8
package-lock.json
generated
8
package-lock.json
generated
|
@ -44,7 +44,7 @@
|
||||||
"fp-ts": "^2.0.1",
|
"fp-ts": "^2.0.1",
|
||||||
"humanize-duration": "^3.15.0",
|
"humanize-duration": "^3.15.0",
|
||||||
"js-yaml": "^3.13.1",
|
"js-yaml": "^3.13.1",
|
||||||
"knub": "^32.0.0-next.18",
|
"knub": "^32.0.0-next.20",
|
||||||
"knub-command-manager": "^9.1.0",
|
"knub-command-manager": "^9.1.0",
|
||||||
"last-commit-log": "^2.1.0",
|
"last-commit-log": "^2.1.0",
|
||||||
"lodash.chunk": "^4.2.0",
|
"lodash.chunk": "^4.2.0",
|
||||||
|
@ -13250,9 +13250,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/knub": {
|
"node_modules/knub": {
|
||||||
"version": "32.0.0-next.18",
|
"version": "32.0.0-next.20",
|
||||||
"resolved": "https://registry.npmjs.org/knub/-/knub-32.0.0-next.18.tgz",
|
"resolved": "https://registry.npmjs.org/knub/-/knub-32.0.0-next.20.tgz",
|
||||||
"integrity": "sha512-RCTozeB6WK17kh76uHKah9eSdN5nfbgrvPDCuq/fV5saZIpG1XBpbLNYJHPjvuoqMqk7BQYbR8OK1VrT52Wj8A==",
|
"integrity": "sha512-RNi6VC4H83HShujPRuIUsuuHhVwvWY4qIaVQSswZPUGtCgY+h8rKtPQ5mCcNAroMJJWr4rVXVXUG7fOfY/ZyBg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"discord-api-types": "^0.37.67",
|
"discord-api-types": "^0.37.67",
|
||||||
"discord.js": "^14.14.1",
|
"discord.js": "^14.14.1",
|
||||||
|
|
Loading…
Add table
Reference in a new issue