mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-06-08 00:05:01 +00:00
feat: update to djs 14.19.3, node 22, zod 4
This commit is contained in:
parent
595e1a0556
commit
09eb8e92f2
189 changed files with 1244 additions and 900 deletions
|
@ -1,5 +1,5 @@
|
|||
import { CooldownManager, PluginOptions, guildPlugin } from "knub";
|
||||
import DefaultLogMessages from "../../data/DefaultLogMessages.json" assert { type: "json" };
|
||||
import DefaultLogMessages from "../../data/DefaultLogMessages.json" with { type: "json" };
|
||||
import { GuildArchives } from "../../data/GuildArchives.js";
|
||||
import { GuildCases } from "../../data/GuildCases.js";
|
||||
import { GuildLogs } from "../../data/GuildLogs.js";
|
||||
|
|
|
@ -49,7 +49,6 @@ export const LogsGuildBanRemoveEvt = logsEvt({
|
|||
user.id,
|
||||
);
|
||||
const mod = relevantAuditLogEntry?.executor ?? null;
|
||||
|
||||
logMemberUnban(pluginData, {
|
||||
mod,
|
||||
userId: user.id,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { User } from "discord.js";
|
||||
import { PartialUser, User } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { LogType } from "../../../data/LogType.js";
|
||||
import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js";
|
||||
|
@ -8,7 +8,7 @@ import { LogsPluginType } from "../types.js";
|
|||
import { log } from "../util/log.js";
|
||||
|
||||
export interface LogMemberBanData {
|
||||
mod: User | UnknownUser | null;
|
||||
mod: User | UnknownUser | PartialUser | null;
|
||||
user: User | UnknownUser;
|
||||
caseNumber: number;
|
||||
reason: string;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Snowflake, User } from "discord.js";
|
||||
import { PartialUser, Snowflake, User } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { LogType } from "../../../data/LogType.js";
|
||||
import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js";
|
||||
|
@ -8,7 +8,7 @@ import { LogsPluginType } from "../types.js";
|
|||
import { log } from "../util/log.js";
|
||||
|
||||
export interface LogMemberUnbanData {
|
||||
mod: User | UnknownUser | null;
|
||||
mod: User | UnknownUser | PartialUser | null;
|
||||
userId: Snowflake;
|
||||
caseNumber: number;
|
||||
reason: string;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { BasePluginType, CooldownManager, guildPluginEventListener } from "knub";
|
||||
import { z } from "zod";
|
||||
import { z } from "zod/v4";
|
||||
import { RegExpRunner } from "../../RegExpRunner.js";
|
||||
import { GuildArchives } from "../../data/GuildArchives.js";
|
||||
import { GuildCases } from "../../data/GuildCases.js";
|
||||
|
@ -29,6 +29,7 @@ const MAX_BATCH_TIME = 5000;
|
|||
// A bit of a workaround so we can pass LogType keys to z.enum()
|
||||
const logTypes = Object.keys(LogType) as [keyof typeof LogType, ...Array<keyof typeof LogType>];
|
||||
const zLogFormats = z.record(z.enum(logTypes), zMessageContent);
|
||||
type TLogFormats = z.infer<typeof zLogFormats>;
|
||||
|
||||
const zLogChannel = z.strictObject({
|
||||
include: z.array(zBoundedCharacters(1, 255)).default([]),
|
||||
|
@ -42,7 +43,7 @@ const zLogChannel = z.strictObject({
|
|||
excluded_threads: z.array(zSnowflake).nullable().default(null),
|
||||
exclude_bots: z.boolean().default(false),
|
||||
excluded_roles: z.array(zSnowflake).nullable().default(null),
|
||||
format: zLogFormats.default({}),
|
||||
format: zLogFormats.default({} as TLogFormats),
|
||||
timestamp_format: z.string().nullable().default(null),
|
||||
include_embed_timestamp: z.boolean().nullable().default(null),
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue