3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-13 21:35:02 +00:00

refactor: convert /backend to ESM

This commit is contained in:
Dragory 2024-04-09 20:57:18 +03:00
parent 31d74c05aa
commit 5772e27cda
No known key found for this signature in database
766 changed files with 3473 additions and 3500 deletions

View file

@ -1,12 +1,12 @@
import { PluginOptions, guildPlugin } from "knub";
import { onGuildEvent } from "../../data/GuildEvents";
import { GuildReminders } from "../../data/GuildReminders";
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
import { RemindCmd } from "./commands/RemindCmd";
import { RemindersCmd } from "./commands/RemindersCmd";
import { RemindersDeleteCmd } from "./commands/RemindersDeleteCmd";
import { postReminder } from "./functions/postReminder";
import { RemindersPluginType, zRemindersConfig } from "./types";
import { onGuildEvent } from "../../data/GuildEvents.js";
import { GuildReminders } from "../../data/GuildReminders.js";
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin.js";
import { RemindCmd } from "./commands/RemindCmd.js";
import { RemindersCmd } from "./commands/RemindersCmd.js";
import { RemindersDeleteCmd } from "./commands/RemindersDeleteCmd.js";
import { postReminder } from "./functions/postReminder.js";
import { RemindersPluginType, zRemindersConfig } from "./types.js";
const defaultOptions: PluginOptions<RemindersPluginType> = {
config: {

View file

@ -1,11 +1,11 @@
import humanizeDuration from "humanize-duration";
import moment from "moment-timezone";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { registerUpcomingReminder } from "../../../data/loops/upcomingRemindersLoop";
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { convertDelayStringToMS, messageLink } from "../../../utils";
import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin";
import { remindersCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
import { registerUpcomingReminder } from "../../../data/loops/upcomingRemindersLoop.js";
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js";
import { convertDelayStringToMS, messageLink } from "../../../utils.js";
import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin.js";
import { remindersCmd } from "../types.js";
export const RemindCmd = remindersCmd({
trigger: ["remind", "remindme", "reminder"],

View file

@ -1,9 +1,9 @@
import humanizeDuration from "humanize-duration";
import moment from "moment-timezone";
import { sendErrorMessage } from "../../../pluginUtils";
import { createChunkedMessage, DBDateFormat, sorter } from "../../../utils";
import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin";
import { remindersCmd } from "../types";
import { sendErrorMessage } from "../../../pluginUtils.js";
import { createChunkedMessage, DBDateFormat, sorter } from "../../../utils.js";
import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin.js";
import { remindersCmd } from "../types.js";
export const RemindersCmd = remindersCmd({
trigger: "reminders",

View file

@ -1,8 +1,8 @@
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { clearUpcomingReminder } from "../../../data/loops/upcomingRemindersLoop";
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { sorter } from "../../../utils";
import { remindersCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
import { clearUpcomingReminder } from "../../../data/loops/upcomingRemindersLoop.js";
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js";
import { sorter } from "../../../utils.js";
import { remindersCmd } from "../types.js";
export const RemindersDeleteCmd = remindersCmd({
trigger: ["reminders delete", "reminders d"],

View file

@ -2,9 +2,9 @@ import { HTTPError, Snowflake } from "discord.js";
import { GuildPluginData } from "knub";
import { disableLinkPreviews } from "knub/helpers";
import moment from "moment-timezone";
import { Reminder } from "../../../data/entities/Reminder";
import { DBDateFormat } from "../../../utils";
import { RemindersPluginType } from "../types";
import { Reminder } from "../../../data/entities/Reminder.js";
import { DBDateFormat } from "../../../utils.js";
import { RemindersPluginType } from "../types.js";
export async function postReminder(pluginData: GuildPluginData<RemindersPluginType>, reminder: Reminder) {
const channel = pluginData.guild.channels.cache.get(reminder.channel_id as Snowflake);

View file

@ -1,5 +1,5 @@
import { ZeppelinPluginInfo } from "../../types";
import { zRemindersConfig } from "./types";
import { ZeppelinPluginInfo } from "../../types.js";
import { zRemindersConfig } from "./types.js";
export const remindersPluginInfo: ZeppelinPluginInfo = {
prettyName: "Reminders",

View file

@ -1,6 +1,6 @@
import { BasePluginType, guildPluginMessageCommand } from "knub";
import z from "zod";
import { GuildReminders } from "../../data/GuildReminders";
import { GuildReminders } from "../../data/GuildReminders.js";
export const zRemindersConfig = z.strictObject({
can_use: z.boolean(),