mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 20:35:02 +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,9 +1,9 @@
|
|||
import { PluginOptions, guildPlugin } from "knub";
|
||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||
import { SaveMessagesToDBCmd } from "./commands/SaveMessagesToDB";
|
||||
import { SavePinsToDBCmd } from "./commands/SavePinsToDB";
|
||||
import { MessageCreateEvt, MessageDeleteBulkEvt, MessageDeleteEvt, MessageUpdateEvt } from "./events/SaveMessagesEvts";
|
||||
import { MessageSaverPluginType, zMessageSaverConfig } from "./types";
|
||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages.js";
|
||||
import { SaveMessagesToDBCmd } from "./commands/SaveMessagesToDB.js";
|
||||
import { SavePinsToDBCmd } from "./commands/SavePinsToDB.js";
|
||||
import { MessageCreateEvt, MessageDeleteBulkEvt, MessageDeleteEvt, MessageUpdateEvt } from "./events/SaveMessagesEvts.js";
|
||||
import { MessageSaverPluginType, zMessageSaverConfig } from "./types.js";
|
||||
|
||||
const defaultOptions: PluginOptions<MessageSaverPluginType> = {
|
||||
config: {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { saveMessagesToDB } from "../saveMessagesToDB";
|
||||
import { messageSaverCmd } from "../types";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
|
||||
import { sendSuccessMessage } from "../../../pluginUtils.js";
|
||||
import { saveMessagesToDB } from "../saveMessagesToDB.js";
|
||||
import { messageSaverCmd } from "../types.js";
|
||||
|
||||
export const SaveMessagesToDBCmd = messageSaverCmd({
|
||||
trigger: "save_messages_to_db",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { saveMessagesToDB } from "../saveMessagesToDB";
|
||||
import { messageSaverCmd } from "../types";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
|
||||
import { sendSuccessMessage } from "../../../pluginUtils.js";
|
||||
import { saveMessagesToDB } from "../saveMessagesToDB.js";
|
||||
import { messageSaverCmd } from "../types.js";
|
||||
|
||||
export const SavePinsToDBCmd = messageSaverCmd({
|
||||
trigger: "save_pins_to_db",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Message, MessageType } from "discord.js";
|
||||
import { messageSaverEvt } from "../types";
|
||||
import { messageSaverEvt } from "../types.js";
|
||||
|
||||
const AFFECTED_MESSAGE_TYPES: MessageType[] = [MessageType.Default, MessageType.Reply, MessageType.ChatInputCommand];
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ZeppelinPluginInfo } from "../../types";
|
||||
import { ZeppelinPluginInfo } from "../../types.js";
|
||||
|
||||
export const messageSaverPluginInfo: ZeppelinPluginInfo = {
|
||||
prettyName: "Message saver",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { GuildTextBasedChannel, Message } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { MessageSaverPluginType } from "./types";
|
||||
import { MessageSaverPluginType } from "./types.js";
|
||||
|
||||
export async function saveMessagesToDB(
|
||||
pluginData: GuildPluginData<MessageSaverPluginType>,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { BasePluginType, guildPluginEventListener, guildPluginMessageCommand } from "knub";
|
||||
import z from "zod";
|
||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages.js";
|
||||
|
||||
export const zMessageSaverConfig = z.strictObject({
|
||||
can_manage: z.boolean(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue