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
backend/src/plugins
AutoDelete
AutoReactions
Automod
BotControl
Cases
Censor
ChannelArchiver
CompanionChannels
ContextMenus
Counters
CustomEvents
GuildAccessMonitor
GuildConfigReloader
GuildInfoSaver
GuildMemberCache
InternalPoster
LocateUser
Logs
MessageSaver
ModActions
Mutes
NameHistory
Persist
Phisherman
PingableRoles
Post
ReactionRoles
Reminders
RoleButtons
RoleManager
Roles
SelfGrantableRoles
Slowmode
Spam
Starboard
Tags
TimeAndDate
UsernameSaver
Utility
WelcomeMessage
ZeppelinPlugin.tsZeppelinPluginBlueprint.tsavailablePlugins.tspluginInfo.ts
|
@ -1,9 +1,8 @@
|
|||
import { PluginOptions } from "knub";
|
||||
import { PluginOptions, guildPlugin } from "knub";
|
||||
import { GuildLogs } from "../../data/GuildLogs";
|
||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { AutoDeletePluginType, zAutoDeleteConfig } from "./types";
|
||||
import { onMessageCreate } from "./util/onMessageCreate";
|
||||
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",
|
||||
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],
|
||||
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 { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||
import { trimPluginDescription } from "../../utils";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { DisableAutoReactionsCmd } from "./commands/DisableAutoReactionsCmd";
|
||||
import { NewAutoReactionsCmd } from "./commands/NewAutoReactionsCmd";
|
||||
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",
|
||||
showInDocs: true,
|
||||
info: {
|
||||
prettyName: "Auto-reactions",
|
||||
description: trimPluginDescription(`
|
||||
Allows setting up automatic reactions to all new messages on a channel
|
||||
`),
|
||||
configSchema: zAutoReactionsConfig,
|
||||
},
|
||||
|
||||
// prettier-ignore
|
||||
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 { GuildAntiraidLevels } from "../../data/GuildAntiraidLevels";
|
||||
import { GuildArchives } from "../../data/GuildArchives";
|
||||
|
@ -15,7 +15,6 @@ import { ModActionsPlugin } from "../ModActions/ModActionsPlugin";
|
|||
import { MutesPlugin } from "../Mutes/MutesPlugin";
|
||||
import { PhishermanPlugin } from "../Phisherman/PhishermanPlugin";
|
||||
import { RoleManagerPlugin } from "../RoleManager/RoleManagerPlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { AntiraidClearCmd } from "./commands/AntiraidClearCmd";
|
||||
import { SetAntiraidCmd } from "./commands/SetAntiraidCmd";
|
||||
import { ViewAntiraidCmd } from "./commands/ViewAntiraidCmd";
|
||||
|
@ -32,7 +31,6 @@ import {
|
|||
import { clearOldRecentNicknameChanges } from "./functions/clearOldNicknameChanges";
|
||||
import { clearOldRecentActions } from "./functions/clearOldRecentActions";
|
||||
import { clearOldRecentSpam } from "./functions/clearOldRecentSpam";
|
||||
import { pluginInfo } from "./info";
|
||||
import { AutomodPluginType, zAutomodConfig } from "./types";
|
||||
|
||||
const defaultOptions = {
|
||||
|
@ -58,10 +56,8 @@ const defaultOptions = {
|
|||
],
|
||||
};
|
||||
|
||||
export const AutomodPlugin = zeppelinGuildPlugin<AutomodPluginType>()({
|
||||
export const AutomodPlugin = guildPlugin<AutomodPluginType>()({
|
||||
name: "automod",
|
||||
showInDocs: true,
|
||||
info: pluginInfo,
|
||||
|
||||
// prettier-ignore
|
||||
dependencies: () => [
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { ZeppelinPluginInfo } from "../../types";
|
||||
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",
|
||||
description: trimPluginDescription(`
|
||||
Allows specifying automated actions in response to triggers. Example use cases include word filtering and spam prevention.
|
||||
`),
|
||||
`),
|
||||
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.
|
||||
|
||||
|
@ -99,6 +99,5 @@ export const pluginInfo: ZeppelinGuildPluginBlueprint["info"] = {
|
|||
Bad custom status on user <@!{user.id}>:
|
||||
{matchSummary}
|
||||
~~~
|
||||
`),
|
||||
configSchema: zAutomodConfig,
|
||||
`),
|
||||
};
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { Snowflake, TextChannel } from "discord.js";
|
||||
import { globalPlugin } from "knub";
|
||||
import { AllowedGuilds } from "../../data/AllowedGuilds";
|
||||
import { ApiPermissionAssignments } from "../../data/ApiPermissionAssignments";
|
||||
import { Configs } from "../../data/Configs";
|
||||
import { GuildArchives } from "../../data/GuildArchives";
|
||||
import { sendSuccessMessage } from "../../pluginUtils";
|
||||
import { zeppelinGlobalPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { getActiveReload, resetActiveReload } from "./activeReload";
|
||||
import { AddDashboardUserCmd } from "./commands/AddDashboardUserCmd";
|
||||
import { AddServerFromInviteCmd } from "./commands/AddServerFromInviteCmd";
|
||||
|
@ -35,7 +35,7 @@ const defaultOptions = {
|
|||
},
|
||||
};
|
||||
|
||||
export const BotControlPlugin = zeppelinGlobalPlugin<BotControlPluginType>()({
|
||||
export const BotControlPlugin = globalPlugin<BotControlPluginType>()({
|
||||
name: "bot_control",
|
||||
configParser: (input) => zBotControlConfig.parse(input),
|
||||
defaultOptions,
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
import { guildPlugin } from "knub";
|
||||
import { CaseTypes } from "../../data/CaseTypes";
|
||||
import { Case } from "../../data/entities/Case";
|
||||
import { GuildArchives } from "../../data/GuildArchives";
|
||||
import { GuildCases } from "../../data/GuildCases";
|
||||
import { GuildLogs } from "../../data/GuildLogs";
|
||||
import { Case } from "../../data/entities/Case";
|
||||
import { mapToPublicFn } from "../../pluginUtils";
|
||||
import { trimPluginDescription } from "../../utils";
|
||||
import { InternalPosterPlugin } from "../InternalPoster/InternalPosterPlugin";
|
||||
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { createCase } from "./functions/createCase";
|
||||
import { createCaseNote } from "./functions/createCaseNote";
|
||||
import { getCaseEmbed } from "./functions/getCaseEmbed";
|
||||
|
@ -34,16 +33,8 @@ const defaultOptions = {
|
|||
},
|
||||
};
|
||||
|
||||
export const CasesPlugin = zeppelinGuildPlugin<CasesPluginType>()({
|
||||
export const CasesPlugin = guildPlugin<CasesPluginType>()({
|
||||
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],
|
||||
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 { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||
import { discardRegExpRunner, getRegExpRunner } from "../../regExpRunners";
|
||||
import { trimPluginDescription } from "../../utils";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { CensorPluginType, zCensorConfig } from "./types";
|
||||
import { onMessageCreate } from "./util/onMessageCreate";
|
||||
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",
|
||||
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],
|
||||
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 { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { ArchiveChannelCmd } from "./commands/ArchiveChannelCmd";
|
||||
import { ChannelArchiverPluginType } from "./types";
|
||||
|
||||
export const ChannelArchiverPlugin = zeppelinGuildPlugin<ChannelArchiverPluginType>()({
|
||||
export const ChannelArchiverPlugin = guildPlugin<ChannelArchiverPluginType>()({
|
||||
name: "channel_archiver",
|
||||
showInDocs: false,
|
||||
|
||||
dependencies: () => [TimeAndDatePlugin],
|
||||
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 { trimPluginDescription } from "../../utils";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { VoiceStateUpdateEvt } from "./events/VoiceStateUpdateEvt";
|
||||
import { CompanionChannelsPluginType, zCompanionChannelsConfig } from "./types";
|
||||
|
||||
|
@ -12,18 +10,8 @@ const defaultOptions = {
|
|||
},
|
||||
};
|
||||
|
||||
export const CompanionChannelsPlugin = zeppelinGuildPlugin<CompanionChannelsPluginType>()({
|
||||
export const CompanionChannelsPlugin = guildPlugin<CompanionChannelsPluginType>()({
|
||||
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],
|
||||
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 { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { MutesPlugin } from "../Mutes/MutesPlugin";
|
||||
import { UtilityPlugin } from "../Utility/UtilityPlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { ContextClickedEvt } from "./events/ContextClickedEvt";
|
||||
import { ContextMenuPluginType, zContextMenusConfig } from "./types";
|
||||
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",
|
||||
showInDocs: false,
|
||||
|
||||
dependencies: () => [MutesPlugin, LogsPlugin, UtilityPlugin],
|
||||
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 { PluginOptions } from "knub";
|
||||
import { PluginOptions, guildPlugin } from "knub";
|
||||
import { GuildCounters } from "../../data/GuildCounters";
|
||||
import { CounterTrigger, parseCounterConditionString } from "../../data/entities/CounterTrigger";
|
||||
import { mapToPublicFn } from "../../pluginUtils";
|
||||
import { MINUTES, convertDelayStringToMS, values } from "../../utils";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { AddCounterCmd } from "./commands/AddCounterCmd";
|
||||
import { CountersListCmd } from "./commands/CountersListCmd";
|
||||
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).
|
||||
* 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",
|
||||
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,
|
||||
// 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 { guildPluginMessageCommand, parseSignature } from "knub";
|
||||
import { guildPlugin, guildPluginMessageCommand, parseSignature } from "knub";
|
||||
import { TSignature } from "knub-command-manager";
|
||||
import { commandTypes } from "../../commandTypes";
|
||||
import { TemplateSafeValueContainer, createTypedTemplateSafeValueContainer } from "../../templateFormatter";
|
||||
|
@ -12,7 +12,6 @@ import {
|
|||
userToTemplateSafeUser,
|
||||
} from "../../utils/templateSafeObjects";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { runEvent } from "./functions/runEvent";
|
||||
import { CustomEventsPluginType, zCustomEventsConfig } from "./types";
|
||||
|
||||
|
@ -22,9 +21,8 @@ const defaultOptions = {
|
|||
},
|
||||
};
|
||||
|
||||
export const CustomEventsPlugin = zeppelinGuildPlugin<CustomEventsPluginType>()({
|
||||
export const CustomEventsPlugin = guildPlugin<CustomEventsPluginType>()({
|
||||
name: "custom_events",
|
||||
showInDocs: false,
|
||||
|
||||
dependencies: () => [LogsPlugin],
|
||||
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 { BasePluginType, GlobalPluginData, globalPluginEventListener } from "knub";
|
||||
import { BasePluginType, GlobalPluginData, globalPlugin, globalPluginEventListener } from "knub";
|
||||
import z from "zod";
|
||||
import { AllowedGuilds } from "../../data/AllowedGuilds";
|
||||
import { Configs } from "../../data/Configs";
|
||||
import { env } from "../../env";
|
||||
import { zeppelinGlobalPlugin } from "../ZeppelinPluginBlueprint";
|
||||
|
||||
interface GuildAccessMonitorPluginType extends BasePluginType {
|
||||
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
|
||||
*/
|
||||
export const GuildAccessMonitorPlugin = zeppelinGlobalPlugin<GuildAccessMonitorPluginType>()({
|
||||
export const GuildAccessMonitorPlugin = globalPlugin<GuildAccessMonitorPluginType>()({
|
||||
name: "guild_access_monitor",
|
||||
configParser: (input) => z.strictObject({}).parse(input),
|
||||
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
import { globalPlugin } from "knub";
|
||||
import z from "zod";
|
||||
import { Configs } from "../../data/Configs";
|
||||
import { zeppelinGlobalPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { reloadChangedGuilds } from "./functions/reloadChangedGuilds";
|
||||
import { GuildConfigReloaderPluginType } from "./types";
|
||||
|
||||
export const GuildConfigReloaderPlugin = zeppelinGlobalPlugin<GuildConfigReloaderPluginType>()({
|
||||
export const GuildConfigReloaderPlugin = globalPlugin<GuildConfigReloaderPluginType>()({
|
||||
name: "guild_config_reloader",
|
||||
showInDocs: false,
|
||||
|
||||
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 { guildPluginEventListener } from "knub";
|
||||
import { guildPlugin, guildPluginEventListener } from "knub";
|
||||
import z from "zod";
|
||||
import { AllowedGuilds } from "../../data/AllowedGuilds";
|
||||
import { ApiPermissionAssignments } from "../../data/ApiPermissionAssignments";
|
||||
import { MINUTES } from "../../utils";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { GuildInfoSaverPluginType } from "./types";
|
||||
|
||||
export const GuildInfoSaverPlugin = zeppelinGuildPlugin<GuildInfoSaverPluginType>()({
|
||||
export const GuildInfoSaverPlugin = guildPlugin<GuildInfoSaverPluginType>()({
|
||||
name: "guild_info_saver",
|
||||
showInDocs: false,
|
||||
|
||||
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 { GuildMemberCache } from "../../data/GuildMemberCache";
|
||||
import { mapToPublicFn } from "../../pluginUtils";
|
||||
import { SECONDS } from "../../utils";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { cancelDeletionOnMemberJoin } from "./events/cancelDeletionOnMemberJoin";
|
||||
import { removeMemberCacheOnMemberLeave } from "./events/removeMemberCacheOnMemberLeave";
|
||||
import { updateMemberCacheOnMemberUpdate } from "./events/updateMemberCacheOnMemberUpdate";
|
||||
|
@ -14,9 +14,8 @@ import { GuildMemberCachePluginType } from "./types";
|
|||
|
||||
const PENDING_SAVE_INTERVAL = 30 * SECONDS;
|
||||
|
||||
export const GuildMemberCachePlugin = zeppelinGuildPlugin<GuildMemberCachePluginType>()({
|
||||
export const GuildMemberCachePlugin = guildPlugin<GuildMemberCachePluginType>()({
|
||||
name: "guild_member_cache",
|
||||
showInDocs: false,
|
||||
|
||||
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 { Queue } from "../../Queue";
|
||||
import { Webhooks } from "../../data/Webhooks";
|
||||
import { mapToPublicFn } from "../../pluginUtils";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { editMessage } from "./functions/editMessage";
|
||||
import { sendMessage } from "./functions/sendMessage";
|
||||
import { InternalPosterPluginType } from "./types";
|
||||
|
@ -13,9 +12,8 @@ const defaultOptions: PluginOptions<InternalPosterPluginType> = {
|
|||
overrides: [],
|
||||
};
|
||||
|
||||
export const InternalPosterPlugin = zeppelinGuildPlugin<InternalPosterPluginType>()({
|
||||
export const InternalPosterPlugin = guildPlugin<InternalPosterPluginType>()({
|
||||
name: "internal_poster",
|
||||
showInDocs: false,
|
||||
|
||||
configParser: (input) => z.strictObject({}).parse(input),
|
||||
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 { GuildVCAlerts } from "../../data/GuildVCAlerts";
|
||||
import { trimPluginDescription } from "../../utils";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { FollowCmd } from "./commands/FollowCmd";
|
||||
import { DeleteFollowCmd, ListFollowCmd } from "./commands/ListFollowCmd";
|
||||
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",
|
||||
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),
|
||||
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 { GuildArchives } from "../../data/GuildArchives";
|
||||
import { GuildCases } from "../../data/GuildCases";
|
||||
|
@ -10,7 +10,6 @@ import { mapToPublicFn } from "../../pluginUtils";
|
|||
import { discardRegExpRunner, getRegExpRunner } from "../../regExpRunners";
|
||||
import { TypedTemplateSafeValueContainer, createTypedTemplateSafeValueContainer } from "../../templateFormatter";
|
||||
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { LogsChannelCreateEvt, LogsChannelDeleteEvt, LogsChannelUpdateEvt } from "./events/LogsChannelModifyEvts";
|
||||
import {
|
||||
LogsEmojiCreateEvt,
|
||||
|
@ -140,13 +139,8 @@ const defaultOptions: PluginOptions<LogsPluginType> = {
|
|||
],
|
||||
};
|
||||
|
||||
export const LogsPlugin = zeppelinGuildPlugin<LogsPluginType>()({
|
||||
export const LogsPlugin = guildPlugin<LogsPluginType>()({
|
||||
name: "logs",
|
||||
showInDocs: true,
|
||||
info: {
|
||||
prettyName: "Logs",
|
||||
configSchema: zLogsConfig,
|
||||
},
|
||||
|
||||
dependencies: async () => [TimeAndDatePlugin, InternalPosterPlugin, (await getCasesPlugin()).CasesPlugin],
|
||||
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 { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { SaveMessagesToDBCmd } from "./commands/SaveMessagesToDB";
|
||||
import { SavePinsToDBCmd } from "./commands/SavePinsToDB";
|
||||
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",
|
||||
showInDocs: false,
|
||||
|
||||
configParser: (input) => zMessageSaverConfig.parse(input),
|
||||
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 { EventEmitter } from "events";
|
||||
import { guildPlugin } from "knub";
|
||||
import { Queue } from "../../Queue";
|
||||
import { GuildCases } from "../../data/GuildCases";
|
||||
import { onGuildEvent } from "../../data/GuildEvents";
|
||||
|
@ -7,12 +8,11 @@ import { GuildLogs } from "../../data/GuildLogs";
|
|||
import { GuildMutes } from "../../data/GuildMutes";
|
||||
import { GuildTempbans } from "../../data/GuildTempbans";
|
||||
import { mapToPublicFn } from "../../pluginUtils";
|
||||
import { MINUTES, trimPluginDescription } from "../../utils";
|
||||
import { MINUTES } from "../../utils";
|
||||
import { CasesPlugin } from "../Cases/CasesPlugin";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { MutesPlugin } from "../Mutes/MutesPlugin";
|
||||
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { AddCaseCmd } from "./commands/AddCaseCmd";
|
||||
import { BanCmd } from "./commands/BanCmd";
|
||||
import { CaseCmd } from "./commands/CaseCmd";
|
||||
|
@ -113,16 +113,8 @@ const defaultOptions = {
|
|||
],
|
||||
};
|
||||
|
||||
export const ModActionsPlugin = zeppelinGuildPlugin<ModActionsPluginType>()({
|
||||
export const ModActionsPlugin = guildPlugin<ModActionsPluginType>()({
|
||||
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],
|
||||
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 { EventEmitter } from "events";
|
||||
import { guildPlugin } from "knub";
|
||||
import { GuildArchives } from "../../data/GuildArchives";
|
||||
import { GuildCases } from "../../data/GuildCases";
|
||||
import { onGuildEvent } from "../../data/GuildEvents";
|
||||
|
@ -9,7 +10,6 @@ import { mapToPublicFn } from "../../pluginUtils";
|
|||
import { CasesPlugin } from "../Cases/CasesPlugin";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { RoleManagerPlugin } from "../RoleManager/RoleManagerPlugin.js";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { ClearBannedMutesCmd } from "./commands/ClearBannedMutesCmd";
|
||||
import { ClearMutesCmd } from "./commands/ClearMutesCmd";
|
||||
import { ClearMutesWithoutRoleCmd } from "./commands/ClearMutesWithoutRoleCmd";
|
||||
|
@ -61,13 +61,8 @@ const defaultOptions = {
|
|||
],
|
||||
};
|
||||
|
||||
export const MutesPlugin = zeppelinGuildPlugin<MutesPluginType>()({
|
||||
export const MutesPlugin = guildPlugin<MutesPluginType>()({
|
||||
name: "mutes",
|
||||
showInDocs: true,
|
||||
info: {
|
||||
prettyName: "Mutes",
|
||||
configSchema: zMutesConfig,
|
||||
},
|
||||
|
||||
dependencies: () => [CasesPlugin, LogsPlugin, RoleManagerPlugin],
|
||||
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 { GuildNicknameHistory } from "../../data/GuildNicknameHistory";
|
||||
import { UsernameHistory } from "../../data/UsernameHistory";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { NamesCmd } from "./commands/NamesCmd";
|
||||
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",
|
||||
showInDocs: false,
|
||||
|
||||
configParser: (input) => zNameHistoryConfig.parse(input),
|
||||
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 { GuildPersistedData } from "../../data/GuildPersistedData";
|
||||
import { trimPluginDescription } from "../../utils";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { RoleManagerPlugin } from "../RoleManager/RoleManagerPlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { LoadDataEvt } from "./events/LoadDataEvt";
|
||||
import { StoreDataEvt } from "./events/StoreDataEvt";
|
||||
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",
|
||||
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],
|
||||
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 { mapToPublicFn } from "../../pluginUtils";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { getDomainInfo } from "./functions/getDomainInfo";
|
||||
import { pluginInfo } from "./info";
|
||||
import { PhishermanPluginType, zPhishermanConfig } from "./types";
|
||||
|
||||
const defaultOptions: PluginOptions<PhishermanPluginType> = {
|
||||
|
@ -13,10 +11,8 @@ const defaultOptions: PluginOptions<PhishermanPluginType> = {
|
|||
overrides: [],
|
||||
};
|
||||
|
||||
export const PhishermanPlugin = zeppelinGuildPlugin<PhishermanPluginType>()({
|
||||
export const PhishermanPlugin = guildPlugin<PhishermanPluginType>()({
|
||||
name: "phisherman",
|
||||
showInDocs: true,
|
||||
info: pluginInfo,
|
||||
|
||||
configParser: (input) => zPhishermanConfig.parse(input),
|
||||
defaultOptions,
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { ZeppelinPluginInfo } from "../../types";
|
||||
import { trimPluginDescription } from "../../utils";
|
||||
import { ZeppelinGuildPluginBlueprint } from "../ZeppelinPluginBlueprint";
|
||||
import { zPhishermanConfig } from "./types";
|
||||
|
||||
export const pluginInfo: ZeppelinGuildPluginBlueprint["info"] = {
|
||||
export const phishermanPluginInfo: ZeppelinPluginInfo = {
|
||||
prettyName: "Phisherman",
|
||||
description: trimPluginDescription(`
|
||||
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,
|
||||
showInDocs: true,
|
||||
};
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import { PluginOptions } from "knub";
|
||||
import { PluginOptions, guildPlugin } from "knub";
|
||||
import { GuildPingableRoles } from "../../data/GuildPingableRoles";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { PingableRoleDisableCmd } from "./commands/PingableRoleDisableCmd";
|
||||
import { PingableRoleEnableCmd } from "./commands/PingableRoleEnableCmd";
|
||||
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",
|
||||
showInDocs: true,
|
||||
info: {
|
||||
prettyName: "Pingable roles",
|
||||
configSchema: zPingableRolesConfig,
|
||||
},
|
||||
|
||||
configParser: (input) => zPingableRolesConfig.parse(input),
|
||||
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 { GuildLogs } from "../../data/GuildLogs";
|
||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||
import { GuildScheduledPosts } from "../../data/GuildScheduledPosts";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { EditCmd } from "./commands/EditCmd";
|
||||
import { EditEmbedCmd } from "./commands/EditEmbedCmd";
|
||||
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",
|
||||
showInDocs: true,
|
||||
info: {
|
||||
prettyName: "Post",
|
||||
configSchema: zPostConfig,
|
||||
},
|
||||
|
||||
dependencies: () => [TimeAndDatePlugin, LogsPlugin],
|
||||
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 { GuildReactionRoles } from "../../data/GuildReactionRoles";
|
||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { ClearReactionRolesCmd } from "./commands/ClearReactionRolesCmd";
|
||||
import { InitReactionRolesCmd } from "./commands/InitReactionRolesCmd";
|
||||
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",
|
||||
showInDocs: true,
|
||||
info: {
|
||||
prettyName: "Reaction roles",
|
||||
legacy: "Consider using the [Role buttons](/docs/plugins/role_buttons) plugin instead.",
|
||||
configSchema: zReactionRolesConfig,
|
||||
},
|
||||
|
||||
dependencies: () => [LogsPlugin],
|
||||
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 { GuildReminders } from "../../data/GuildReminders";
|
||||
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { RemindCmd } from "./commands/RemindCmd";
|
||||
import { RemindersCmd } from "./commands/RemindersCmd";
|
||||
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",
|
||||
showInDocs: true,
|
||||
info: {
|
||||
prettyName: "Reminders",
|
||||
configSchema: zRemindersConfig,
|
||||
},
|
||||
|
||||
dependencies: () => [TimeAndDatePlugin],
|
||||
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 { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { RoleManagerPlugin } from "../RoleManager/RoleManagerPlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { resetButtonsCmd } from "./commands/resetButtons";
|
||||
import { onButtonInteraction } from "./events/buttonInteraction";
|
||||
import { applyAllRoleButtons } from "./functions/applyAllRoleButtons";
|
||||
import { pluginInfo } from "./info";
|
||||
import { RoleButtonsPluginType, zRoleButtonsConfig } from "./types";
|
||||
|
||||
export const RoleButtonsPlugin = zeppelinGuildPlugin<RoleButtonsPluginType>()({
|
||||
export const RoleButtonsPlugin = guildPlugin<RoleButtonsPluginType>()({
|
||||
name: "role_buttons",
|
||||
info: pluginInfo,
|
||||
showInDocs: true,
|
||||
|
||||
defaultOptions: {
|
||||
config: {
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import { ZeppelinPluginInfo } from "../../types";
|
||||
import { trimPluginDescription } from "../../utils";
|
||||
import { ZeppelinGuildPluginBlueprint } from "../ZeppelinPluginBlueprint";
|
||||
import { zRoleButtonsConfig } from "./types";
|
||||
|
||||
export const pluginInfo: ZeppelinGuildPluginBlueprint["info"] = {
|
||||
export const roleButtonsPluginInfo: ZeppelinPluginInfo = {
|
||||
showInDocs: true,
|
||||
prettyName: "Role buttons",
|
||||
description: trimPluginDescription(`
|
||||
Allow users to pick roles by clicking on buttons
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { guildPlugin } from "knub";
|
||||
import { GuildRoleQueue } from "../../data/GuildRoleQueue";
|
||||
import { mapToPublicFn } from "../../pluginUtils";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { addPriorityRole } from "./functions/addPriorityRole";
|
||||
import { addRole } from "./functions/addRole";
|
||||
import { removePriorityRole } from "./functions/removePriorityRole";
|
||||
|
@ -9,9 +9,8 @@ import { removeRole } from "./functions/removeRole";
|
|||
import { runRoleAssignmentLoop } from "./functions/runRoleAssignmentLoop";
|
||||
import { RoleManagerPluginType, zRoleManagerConfig } from "./types";
|
||||
|
||||
export const RoleManagerPlugin = zeppelinGuildPlugin<RoleManagerPluginType>()({
|
||||
export const RoleManagerPlugin = guildPlugin<RoleManagerPluginType>()({
|
||||
name: "role_manager",
|
||||
showInDocs: false,
|
||||
|
||||
dependencies: () => [LogsPlugin],
|
||||
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 { trimPluginDescription } from "../../utils";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { RoleManagerPlugin } from "../RoleManager/RoleManagerPlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { AddRoleCmd } from "./commands/AddRoleCmd";
|
||||
import { MassAddRoleCmd } from "./commands/MassAddRoleCmd";
|
||||
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",
|
||||
showInDocs: true,
|
||||
info: {
|
||||
prettyName: "Roles",
|
||||
description: trimPluginDescription(`
|
||||
Enables authorised users to add and remove whitelisted roles with a command.
|
||||
`),
|
||||
configSchema: zRolesConfig,
|
||||
},
|
||||
|
||||
dependencies: () => [LogsPlugin, RoleManagerPlugin],
|
||||
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 { trimPluginDescription } from "../../utils";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { CooldownManager, PluginOptions, guildPlugin } from "knub";
|
||||
import { RoleAddCmd } from "./commands/RoleAddCmd";
|
||||
import { RoleHelpCmd } from "./commands/RoleHelpCmd";
|
||||
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",
|
||||
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),
|
||||
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 { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||
import { GuildSlowmodes } from "../../data/GuildSlowmodes";
|
||||
import { SECONDS } from "../../utils";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { SlowmodeClearCmd } from "./commands/SlowmodeClearCmd";
|
||||
import { SlowmodeDisableCmd } from "./commands/SlowmodeDisableCmd";
|
||||
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",
|
||||
showInDocs: true,
|
||||
info: {
|
||||
prettyName: "Slowmode",
|
||||
configSchema: zSlowmodeConfig,
|
||||
},
|
||||
|
||||
// prettier-ignore
|
||||
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 { GuildLogs } from "../../data/GuildLogs";
|
||||
import { GuildMutes } from "../../data/GuildMutes";
|
||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||
import { trimPluginDescription } from "../../utils";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { SpamVoiceStateUpdateEvt } from "./events/SpamVoiceEvt";
|
||||
import { SpamPluginType, zSpamConfig } from "./types";
|
||||
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",
|
||||
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],
|
||||
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 { GuildStarboardMessages } from "../../data/GuildStarboardMessages";
|
||||
import { GuildStarboardReactions } from "../../data/GuildStarboardReactions";
|
||||
import { trimPluginDescription } from "../../utils";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { MigratePinsCmd } from "./commands/MigratePinsCmd";
|
||||
import { StarboardReactionAddEvt } from "./events/StarboardReactionAddEvt";
|
||||
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",
|
||||
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),
|
||||
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 humanizeDuration from "humanize-duration";
|
||||
import { PluginOptions } from "knub";
|
||||
import { PluginOptions, guildPlugin } from "knub";
|
||||
import moment from "moment-timezone";
|
||||
import { GuildArchives } from "../../data/GuildArchives";
|
||||
import { GuildLogs } from "../../data/GuildLogs";
|
||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||
import { GuildTags } from "../../data/GuildTags";
|
||||
import { mapToPublicFn } from "../../pluginUtils";
|
||||
import { convertDelayStringToMS, trimPluginDescription } from "../../utils";
|
||||
import { convertDelayStringToMS } from "../../utils";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { TagCreateCmd } from "./commands/TagCreateCmd";
|
||||
import { TagDeleteCmd } from "./commands/TagDeleteCmd";
|
||||
import { TagEvalCmd } from "./commands/TagEvalCmd";
|
||||
import { TagListCmd } from "./commands/TagListCmd";
|
||||
import { TagSourceCmd } from "./commands/TagSourceCmd";
|
||||
import { generateTemplateMarkdown } from "./docs";
|
||||
import { TemplateFunctions } from "./templateFunctions";
|
||||
import { TagsPluginType, zTagsConfig } from "./types";
|
||||
import { findTagByName } from "./util/findTagByName";
|
||||
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",
|
||||
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],
|
||||
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 { mapToPublicFn } from "../../pluginUtils";
|
||||
import { trimPluginDescription } from "../../utils";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { ResetTimezoneCmd } from "./commands/ResetTimezoneCmd";
|
||||
import { SetTimezoneCmd } from "./commands/SetTimezoneCmd";
|
||||
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",
|
||||
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),
|
||||
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 { UsernameHistory } from "../../data/UsernameHistory";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { MessageCreateUpdateUsernameEvt, VoiceChannelJoinUpdateUsernameEvt } from "./events/UpdateUsernameEvts";
|
||||
import { UsernameSaverPluginType, zUsernameSaverConfig } from "./types";
|
||||
|
||||
export const UsernameSaverPlugin = zeppelinGuildPlugin<UsernameSaverPluginType>()({
|
||||
export const UsernameSaverPlugin = guildPlugin<UsernameSaverPluginType>()({
|
||||
name: "username_saver",
|
||||
showInDocs: false,
|
||||
|
||||
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 { PluginOptions } from "knub";
|
||||
import { PluginOptions, guildPlugin } from "knub";
|
||||
import { GuildArchives } from "../../data/GuildArchives";
|
||||
import { GuildCases } from "../../data/GuildCases";
|
||||
import { GuildLogs } from "../../data/GuildLogs";
|
||||
|
@ -10,7 +10,6 @@ import { discardRegExpRunner, getRegExpRunner } from "../../regExpRunners";
|
|||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { ModActionsPlugin } from "../ModActions/ModActionsPlugin";
|
||||
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { AboutCmd } from "./commands/AboutCmd";
|
||||
import { AvatarCmd } from "./commands/AvatarCmd";
|
||||
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",
|
||||
showInDocs: true,
|
||||
info: {
|
||||
prettyName: "Utility",
|
||||
configSchema: zUtilityConfig,
|
||||
},
|
||||
|
||||
dependencies: () => [TimeAndDatePlugin, ModActionsPlugin, LogsPlugin],
|
||||
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 { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { SendWelcomeMessageEvt } from "./events/SendWelcomeMessageEvt";
|
||||
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",
|
||||
showInDocs: true,
|
||||
info: {
|
||||
prettyName: "Welcome message",
|
||||
configSchema: zWelcomeMessageConfig,
|
||||
},
|
||||
|
||||
dependencies: () => [LogsPlugin],
|
||||
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 { AutoReactionsPlugin } from "./AutoReactions/AutoReactionsPlugin";
|
||||
import { AutomodPlugin } from "./Automod/AutomodPlugin";
|
||||
|
@ -37,10 +38,9 @@ import { TimeAndDatePlugin } from "./TimeAndDate/TimeAndDatePlugin";
|
|||
import { UsernameSaverPlugin } from "./UsernameSaver/UsernameSaverPlugin";
|
||||
import { UtilityPlugin } from "./Utility/UtilityPlugin";
|
||||
import { WelcomeMessagePlugin } from "./WelcomeMessage/WelcomeMessagePlugin";
|
||||
import { ZeppelinGlobalPluginBlueprint, ZeppelinGuildPluginBlueprint } from "./ZeppelinPluginBlueprint";
|
||||
|
||||
// prettier-ignore
|
||||
export const guildPlugins: Array<ZeppelinGuildPluginBlueprint<any>> = [
|
||||
export const guildPlugins: Array<GuildPluginBlueprint<any, any>> = [
|
||||
AutoDeletePlugin,
|
||||
AutoReactionsPlugin,
|
||||
GuildInfoSaverPlugin,
|
||||
|
@ -81,14 +81,14 @@ export const guildPlugins: Array<ZeppelinGuildPluginBlueprint<any>> = [
|
|||
];
|
||||
|
||||
// prettier-ignore
|
||||
export const globalPlugins: Array<ZeppelinGlobalPluginBlueprint<any>> = [
|
||||
export const globalPlugins: Array<GlobalPluginBlueprint<any, any>> = [
|
||||
GuildConfigReloaderPlugin,
|
||||
BotControlPlugin,
|
||||
GuildAccessMonitorPlugin,
|
||||
];
|
||||
|
||||
// prettier-ignore
|
||||
export const baseGuildPlugins: Array<ZeppelinGuildPluginBlueprint<any>> = [
|
||||
export const baseGuildPlugins: Array<GuildPluginBlueprint<any, any>> = [
|
||||
GuildInfoSaverPlugin,
|
||||
MessageSaverPlugin,
|
||||
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,
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue