mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-14 22:05:01 +00:00
refactor: convert /backend to ESM
This commit is contained in:
parent
31d74c05aa
commit
5772e27cda
766 changed files with 3473 additions and 3500 deletions
|
@ -1,19 +1,19 @@
|
|||
import { GuildChannel, GuildMember, User } from "discord.js";
|
||||
import { guildPlugin, guildPluginMessageCommand, parseSignature } from "knub";
|
||||
import { TSignature } from "knub-command-manager";
|
||||
import { commandTypes } from "../../commandTypes";
|
||||
import { TemplateSafeValueContainer, createTypedTemplateSafeValueContainer } from "../../templateFormatter";
|
||||
import { UnknownUser } from "../../utils";
|
||||
import { isScalar } from "../../utils/isScalar";
|
||||
import { commandTypes } from "../../commandTypes.js";
|
||||
import { TemplateSafeValueContainer, createTypedTemplateSafeValueContainer } from "../../templateFormatter.js";
|
||||
import { UnknownUser } from "../../utils.js";
|
||||
import { isScalar } from "../../utils/isScalar.js";
|
||||
import {
|
||||
channelToTemplateSafeChannel,
|
||||
memberToTemplateSafeMember,
|
||||
messageToTemplateSafeMessage,
|
||||
userToTemplateSafeUser,
|
||||
} from "../../utils/templateSafeObjects";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { runEvent } from "./functions/runEvent";
|
||||
import { CustomEventsPluginType, zCustomEventsConfig } from "./types";
|
||||
} from "../../utils/templateSafeObjects.js";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin.js";
|
||||
import { runEvent } from "./functions/runEvent.js";
|
||||
import { CustomEventsPluginType, zCustomEventsConfig } from "./types.js";
|
||||
|
||||
const defaultOptions = {
|
||||
config: {
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import z from "zod";
|
||||
import { canActOn } from "../../../pluginUtils";
|
||||
import { renderTemplate, TemplateSafeValueContainer } from "../../../templateFormatter";
|
||||
import { resolveMember, zSnowflake } from "../../../utils";
|
||||
import { ActionError } from "../ActionError";
|
||||
import { catchTemplateError } from "../catchTemplateError";
|
||||
import { CustomEventsPluginType, TCustomEvent } from "../types";
|
||||
import { canActOn } from "../../../pluginUtils.js";
|
||||
import { renderTemplate, TemplateSafeValueContainer } from "../../../templateFormatter.js";
|
||||
import { resolveMember, zSnowflake } from "../../../utils.js";
|
||||
import { ActionError } from "../ActionError.js";
|
||||
import { catchTemplateError } from "../catchTemplateError.js";
|
||||
import { CustomEventsPluginType, TCustomEvent } from "../types.js";
|
||||
|
||||
export const zAddRoleAction = z.strictObject({
|
||||
type: z.literal("add_role"),
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import z from "zod";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { renderTemplate, TemplateSafeValueContainer } from "../../../templateFormatter";
|
||||
import { zBoundedCharacters, zSnowflake } from "../../../utils";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin";
|
||||
import { ActionError } from "../ActionError";
|
||||
import { catchTemplateError } from "../catchTemplateError";
|
||||
import { CustomEventsPluginType, TCustomEvent } from "../types";
|
||||
import { CaseTypes } from "../../../data/CaseTypes.js";
|
||||
import { renderTemplate, TemplateSafeValueContainer } from "../../../templateFormatter.js";
|
||||
import { zBoundedCharacters, zSnowflake } from "../../../utils.js";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin.js";
|
||||
import { ActionError } from "../ActionError.js";
|
||||
import { catchTemplateError } from "../catchTemplateError.js";
|
||||
import { CustomEventsPluginType, TCustomEvent } from "../types.js";
|
||||
|
||||
export const zCreateCaseAction = z.strictObject({
|
||||
type: z.literal("create_case"),
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { Snowflake } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import z from "zod";
|
||||
import { TemplateSafeValueContainer } from "../../../templateFormatter";
|
||||
import { convertDelayStringToMS, noop, zDelayString, zSnowflake } from "../../../utils";
|
||||
import { ActionError } from "../ActionError";
|
||||
import { CustomEventsPluginType, TCustomEvent } from "../types";
|
||||
import { TemplateSafeValueContainer } from "../../../templateFormatter.js";
|
||||
import { convertDelayStringToMS, noop, zDelayString, zSnowflake } from "../../../utils.js";
|
||||
import { ActionError } from "../ActionError.js";
|
||||
import { CustomEventsPluginType, TCustomEvent } from "../types.js";
|
||||
|
||||
export const zMakeRoleMentionableAction = z.strictObject({
|
||||
type: z.literal("make_role_mentionable"),
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { Snowflake } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import z from "zod";
|
||||
import { TemplateSafeValueContainer } from "../../../templateFormatter";
|
||||
import { zSnowflake } from "../../../utils";
|
||||
import { ActionError } from "../ActionError";
|
||||
import { CustomEventsPluginType, TCustomEvent } from "../types";
|
||||
import { TemplateSafeValueContainer } from "../../../templateFormatter.js";
|
||||
import { zSnowflake } from "../../../utils.js";
|
||||
import { ActionError } from "../ActionError.js";
|
||||
import { CustomEventsPluginType, TCustomEvent } from "../types.js";
|
||||
|
||||
export const zMakeRoleUnmentionableAction = z.strictObject({
|
||||
type: z.literal("make_role_unmentionable"),
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { Snowflake, TextChannel } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import z from "zod";
|
||||
import { TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter";
|
||||
import { zBoundedCharacters, zSnowflake } from "../../../utils";
|
||||
import { ActionError } from "../ActionError";
|
||||
import { catchTemplateError } from "../catchTemplateError";
|
||||
import { CustomEventsPluginType } from "../types";
|
||||
import { TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter.js";
|
||||
import { zBoundedCharacters, zSnowflake } from "../../../utils.js";
|
||||
import { ActionError } from "../ActionError.js";
|
||||
import { catchTemplateError } from "../catchTemplateError.js";
|
||||
import { CustomEventsPluginType } from "../types.js";
|
||||
|
||||
export const zMessageAction = z.strictObject({
|
||||
type: z.literal("message"),
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { Snowflake, VoiceChannel } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import z from "zod";
|
||||
import { canActOn } from "../../../pluginUtils";
|
||||
import { TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter";
|
||||
import { resolveMember, zSnowflake } from "../../../utils";
|
||||
import { ActionError } from "../ActionError";
|
||||
import { catchTemplateError } from "../catchTemplateError";
|
||||
import { CustomEventsPluginType, TCustomEvent } from "../types";
|
||||
import { canActOn } from "../../../pluginUtils.js";
|
||||
import { TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter.js";
|
||||
import { resolveMember, zSnowflake } from "../../../utils.js";
|
||||
import { ActionError } from "../ActionError.js";
|
||||
import { catchTemplateError } from "../catchTemplateError.js";
|
||||
import { CustomEventsPluginType, TCustomEvent } from "../types.js";
|
||||
|
||||
export const zMoveToVoiceChannelAction = z.strictObject({
|
||||
type: z.literal("move_to_vc"),
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { PermissionsBitField, PermissionsString, Snowflake } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import z from "zod";
|
||||
import { TemplateSafeValueContainer } from "../../../templateFormatter";
|
||||
import { zSnowflake } from "../../../utils";
|
||||
import { ActionError } from "../ActionError";
|
||||
import { CustomEventsPluginType, TCustomEvent } from "../types";
|
||||
import { TemplateSafeValueContainer } from "../../../templateFormatter.js";
|
||||
import { zSnowflake } from "../../../utils.js";
|
||||
import { ActionError } from "../ActionError.js";
|
||||
import { CustomEventsPluginType, TCustomEvent } from "../types.js";
|
||||
|
||||
export const zSetChannelPermissionOverridesAction = z.strictObject({
|
||||
type: z.literal("set_channel_permission_overrides"),
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { TemplateParseError } from "../../templateFormatter";
|
||||
import { ActionError } from "./ActionError";
|
||||
import { TemplateParseError } from "../../templateFormatter.js";
|
||||
import { ActionError } from "./ActionError.js";
|
||||
|
||||
export function catchTemplateError(fn: () => Promise<string>, errorText: string): Promise<string> {
|
||||
try {
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
import { Message } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { sendErrorMessage } from "../../../pluginUtils";
|
||||
import { TemplateSafeValueContainer } from "../../../templateFormatter";
|
||||
import { ActionError } from "../ActionError";
|
||||
import { addRoleAction } from "../actions/addRoleAction";
|
||||
import { createCaseAction } from "../actions/createCaseAction";
|
||||
import { makeRoleMentionableAction } from "../actions/makeRoleMentionableAction";
|
||||
import { makeRoleUnmentionableAction } from "../actions/makeRoleUnmentionableAction";
|
||||
import { messageAction } from "../actions/messageAction";
|
||||
import { moveToVoiceChannelAction } from "../actions/moveToVoiceChannelAction";
|
||||
import { setChannelPermissionOverridesAction } from "../actions/setChannelPermissionOverrides";
|
||||
import { CustomEventsPluginType, TCustomEvent } from "../types";
|
||||
import { sendErrorMessage } from "../../../pluginUtils.js";
|
||||
import { TemplateSafeValueContainer } from "../../../templateFormatter.js";
|
||||
import { ActionError } from "../ActionError.js";
|
||||
import { addRoleAction } from "../actions/addRoleAction.js";
|
||||
import { createCaseAction } from "../actions/createCaseAction.js";
|
||||
import { makeRoleMentionableAction } from "../actions/makeRoleMentionableAction.js";
|
||||
import { makeRoleUnmentionableAction } from "../actions/makeRoleUnmentionableAction.js";
|
||||
import { messageAction } from "../actions/messageAction.js";
|
||||
import { moveToVoiceChannelAction } from "../actions/moveToVoiceChannelAction.js";
|
||||
import { setChannelPermissionOverridesAction } from "../actions/setChannelPermissionOverrides.js";
|
||||
import { CustomEventsPluginType, TCustomEvent } from "../types.js";
|
||||
|
||||
export async function runEvent(
|
||||
pluginData: GuildPluginData<CustomEventsPluginType>,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ZeppelinPluginInfo } from "../../types";
|
||||
import { ZeppelinPluginInfo } from "../../types.js";
|
||||
|
||||
export const customEventsPluginInfo: ZeppelinPluginInfo = {
|
||||
prettyName: "Custom events",
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import { BasePluginType } from "knub";
|
||||
import z from "zod";
|
||||
import { zBoundedCharacters, zBoundedRecord } from "../../utils";
|
||||
import { zAddRoleAction } from "./actions/addRoleAction";
|
||||
import { zCreateCaseAction } from "./actions/createCaseAction";
|
||||
import { zMakeRoleMentionableAction } from "./actions/makeRoleMentionableAction";
|
||||
import { zMakeRoleUnmentionableAction } from "./actions/makeRoleUnmentionableAction";
|
||||
import { zMessageAction } from "./actions/messageAction";
|
||||
import { zMoveToVoiceChannelAction } from "./actions/moveToVoiceChannelAction";
|
||||
import { zSetChannelPermissionOverridesAction } from "./actions/setChannelPermissionOverrides";
|
||||
import { zBoundedCharacters, zBoundedRecord } from "../../utils.js";
|
||||
import { zAddRoleAction } from "./actions/addRoleAction.js";
|
||||
import { zCreateCaseAction } from "./actions/createCaseAction.js";
|
||||
import { zMakeRoleMentionableAction } from "./actions/makeRoleMentionableAction.js";
|
||||
import { zMakeRoleUnmentionableAction } from "./actions/makeRoleUnmentionableAction.js";
|
||||
import { zMessageAction } from "./actions/messageAction.js";
|
||||
import { zMoveToVoiceChannelAction } from "./actions/moveToVoiceChannelAction.js";
|
||||
import { zSetChannelPermissionOverridesAction } from "./actions/setChannelPermissionOverrides.js";
|
||||
|
||||
const zCommandTrigger = z.strictObject({
|
||||
type: z.literal("command"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue