mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-07-08 03:27:20 +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 { Queue } from "../../Queue";
|
||||
import { GuildNicknameHistory } from "../../data/GuildNicknameHistory";
|
||||
import { UsernameHistory } from "../../data/UsernameHistory";
|
||||
import { NamesCmd } from "./commands/NamesCmd";
|
||||
import { NameHistoryPluginType, zNameHistoryConfig } from "./types";
|
||||
import { Queue } from "../../Queue.js";
|
||||
import { GuildNicknameHistory } from "../../data/GuildNicknameHistory.js";
|
||||
import { UsernameHistory } from "../../data/UsernameHistory.js";
|
||||
import { NamesCmd } from "./commands/NamesCmd.js";
|
||||
import { NameHistoryPluginType, zNameHistoryConfig } from "./types.js";
|
||||
|
||||
const defaultOptions: PluginOptions<NameHistoryPluginType> = {
|
||||
config: {
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { Snowflake } from "discord.js";
|
||||
import { createChunkedMessage, disableCodeBlocks } from "knub/helpers";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { MAX_NICKNAME_ENTRIES_PER_USER } from "../../../data/GuildNicknameHistory";
|
||||
import { MAX_USERNAME_ENTRIES_PER_USER } from "../../../data/UsernameHistory";
|
||||
import { NICKNAME_RETENTION_PERIOD } from "../../../data/cleanup/nicknames";
|
||||
import { sendErrorMessage } from "../../../pluginUtils";
|
||||
import { DAYS, renderUsername } from "../../../utils";
|
||||
import { nameHistoryCmd } from "../types";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
|
||||
import { MAX_NICKNAME_ENTRIES_PER_USER } from "../../../data/GuildNicknameHistory.js";
|
||||
import { MAX_USERNAME_ENTRIES_PER_USER } from "../../../data/UsernameHistory.js";
|
||||
import { NICKNAME_RETENTION_PERIOD } from "../../../data/cleanup/nicknames.js";
|
||||
import { sendErrorMessage } from "../../../pluginUtils.js";
|
||||
import { DAYS, renderUsername } from "../../../utils.js";
|
||||
import { nameHistoryCmd } from "../types.js";
|
||||
|
||||
export const NamesCmd = nameHistoryCmd({
|
||||
trigger: "names",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { nameHistoryEvt } from "../types";
|
||||
import { updateNickname } from "../updateNickname";
|
||||
import { nameHistoryEvt } from "../types.js";
|
||||
import { updateNickname } from "../updateNickname.js";
|
||||
|
||||
export const ChannelJoinEvt = nameHistoryEvt({
|
||||
event: "voiceStateUpdate",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { ZeppelinPluginInfo } from "../../types";
|
||||
import { zNameHistoryConfig } from "./types";
|
||||
import { ZeppelinPluginInfo } from "../../types.js";
|
||||
import { zNameHistoryConfig } from "./types.js";
|
||||
|
||||
export const nameHistoryPluginInfo: ZeppelinPluginInfo = {
|
||||
prettyName: "Name history",
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { BasePluginType, guildPluginEventListener, guildPluginMessageCommand } from "knub";
|
||||
import z from "zod";
|
||||
import { Queue } from "../../Queue";
|
||||
import { GuildNicknameHistory } from "../../data/GuildNicknameHistory";
|
||||
import { UsernameHistory } from "../../data/UsernameHistory";
|
||||
import { Queue } from "../../Queue.js";
|
||||
import { GuildNicknameHistory } from "../../data/GuildNicknameHistory.js";
|
||||
import { UsernameHistory } from "../../data/UsernameHistory.js";
|
||||
|
||||
export const zNameHistoryConfig = z.strictObject({
|
||||
can_view: z.boolean(),
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { GuildMember } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { NameHistoryPluginType } from "./types";
|
||||
import { NameHistoryPluginType } from "./types.js";
|
||||
|
||||
export async function updateNickname(pluginData: GuildPluginData<NameHistoryPluginType>, member: GuildMember) {
|
||||
if (!member) return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue