refactor: convert /backend to ESM
This commit is contained in:
parent
31d74c05aa
commit
5772e27cda
766 changed files with 3473 additions and 3500 deletions
|
@ -1,11 +1,11 @@
|
|||
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 { ContextClickedEvt } from "./events/ContextClickedEvt";
|
||||
import { ContextMenuPluginType, zContextMenusConfig } from "./types";
|
||||
import { loadAllCommands } from "./utils/loadAllCommands";
|
||||
import { GuildContextMenuLinks } from "../../data/GuildContextMenuLinks.js";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin.js";
|
||||
import { MutesPlugin } from "../Mutes/MutesPlugin.js";
|
||||
import { UtilityPlugin } from "../Utility/UtilityPlugin.js";
|
||||
import { ContextClickedEvt } from "./events/ContextClickedEvt.js";
|
||||
import { ContextMenuPluginType, zContextMenusConfig } from "./types.js";
|
||||
import { loadAllCommands } from "./utils/loadAllCommands.js";
|
||||
|
||||
const defaultOptions: PluginOptions<ContextMenuPluginType> = {
|
||||
config: {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { ContextMenuCommandInteraction, TextChannel } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { ERRORS, RecoverablePluginError } from "../../../RecoverablePluginError";
|
||||
import { UtilityPlugin } from "../../../plugins/Utility/UtilityPlugin";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { ContextMenuPluginType } from "../types";
|
||||
import { ERRORS, RecoverablePluginError } from "../../../RecoverablePluginError.js";
|
||||
import { UtilityPlugin } from "../../../plugins/Utility/UtilityPlugin.js";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin.js";
|
||||
import { ContextMenuPluginType } from "../types.js";
|
||||
|
||||
export async function cleanAction(
|
||||
pluginData: GuildPluginData<ContextMenuPluginType>,
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import { ContextMenuCommandInteraction } from "discord.js";
|
||||
import humanizeDuration from "humanize-duration";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { ERRORS, RecoverablePluginError } from "../../../RecoverablePluginError";
|
||||
import { canActOn } from "../../../pluginUtils";
|
||||
import { convertDelayStringToMS } from "../../../utils";
|
||||
import { CaseArgs } from "../../Cases/types";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { ModActionsPlugin } from "../../ModActions/ModActionsPlugin";
|
||||
import { MutesPlugin } from "../../Mutes/MutesPlugin";
|
||||
import { ContextMenuPluginType } from "../types";
|
||||
import { ERRORS, RecoverablePluginError } from "../../../RecoverablePluginError.js";
|
||||
import { canActOn } from "../../../pluginUtils.js";
|
||||
import { convertDelayStringToMS } from "../../../utils.js";
|
||||
import { CaseArgs } from "../../Cases/types.js";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin.js";
|
||||
import { ModActionsPlugin } from "../../ModActions/ModActionsPlugin.js";
|
||||
import { MutesPlugin } from "../../Mutes/MutesPlugin.js";
|
||||
import { ContextMenuPluginType } from "../types.js";
|
||||
|
||||
export async function muteAction(
|
||||
pluginData: GuildPluginData<ContextMenuPluginType>,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { ContextMenuCommandInteraction } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { UtilityPlugin } from "../../../plugins/Utility/UtilityPlugin";
|
||||
import { ContextMenuPluginType } from "../types";
|
||||
import { UtilityPlugin } from "../../../plugins/Utility/UtilityPlugin.js";
|
||||
import { ContextMenuPluginType } from "../types.js";
|
||||
|
||||
export async function userInfoAction(
|
||||
pluginData: GuildPluginData<ContextMenuPluginType>,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { contextMenuEvt } from "../types";
|
||||
import { routeContextAction } from "../utils/contextRouter";
|
||||
import { contextMenuEvt } from "../types.js";
|
||||
import { routeContextAction } from "../utils/contextRouter.js";
|
||||
|
||||
export const ContextClickedEvt = contextMenuEvt({
|
||||
event: "interactionCreate",
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ZeppelinPluginInfo } from "../../types";
|
||||
import { ZeppelinPluginInfo } from "../../types.js";
|
||||
|
||||
export const contextMenuPluginInfo: ZeppelinPluginInfo = {
|
||||
showInDocs: false,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { BasePluginType, guildPluginEventListener } from "knub";
|
||||
import z from "zod";
|
||||
import { GuildContextMenuLinks } from "../../data/GuildContextMenuLinks";
|
||||
import { GuildContextMenuLinks } from "../../data/GuildContextMenuLinks.js";
|
||||
|
||||
export const zContextMenusConfig = z.strictObject({
|
||||
can_use: z.boolean(),
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { ContextMenuCommandInteraction } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { ContextMenuPluginType } from "../types";
|
||||
import { hardcodedActions } from "./hardcodedContextOptions";
|
||||
import { ContextMenuPluginType } from "../types.js";
|
||||
import { hardcodedActions } from "./hardcodedContextOptions.js";
|
||||
|
||||
export async function routeContextAction(
|
||||
pluginData: GuildPluginData<ContextMenuPluginType>,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { cleanAction } from "../actions/clean";
|
||||
import { muteAction } from "../actions/mute";
|
||||
import { userInfoAction } from "../actions/userInfo";
|
||||
import { cleanAction } from "../actions/clean.js";
|
||||
import { muteAction } from "../actions/mute.js";
|
||||
import { userInfoAction } from "../actions/userInfo.js";
|
||||
|
||||
export const hardcodedContext: Record<string, string> = {
|
||||
user_muteindef: "Mute Indefinitely",
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { ApplicationCommandData, ApplicationCommandType } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { LogsPlugin } from "../../../plugins/Logs/LogsPlugin";
|
||||
import { ContextMenuPluginType } from "../types";
|
||||
import { hardcodedContext } from "./hardcodedContextOptions";
|
||||
import { LogsPlugin } from "../../../plugins/Logs/LogsPlugin.js";
|
||||
import { ContextMenuPluginType } from "../types.js";
|
||||
import { hardcodedContext } from "./hardcodedContextOptions.js";
|
||||
|
||||
export async function loadAllCommands(pluginData: GuildPluginData<ContextMenuPluginType>) {
|
||||
const comms = await pluginData.client.application!.commands;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue