3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-14 22:05:01 +00:00

chore: run prettier

This commit is contained in:
Dragory 2024-01-27 14:23:13 +02:00
parent 77ab2718e7
commit 873bf7eb99
No known key found for this signature in database
54 changed files with 462 additions and 416 deletions

View file

@ -123,7 +123,7 @@ const defaultOptions: PluginOptions<LogsPluginType> = {
timestamp: FORMAT_NO_TIMESTAMP,
...DefaultLogMessages,
},
ping_user: true,
ping_user: true,
allow_user_mentions: false,
timestamp_format: "[<t:]X[>]",
include_embed_timestamp: true,

View file

@ -32,7 +32,9 @@ export function logMessageDelete(pluginData: GuildPluginData<LogsPluginType>, da
// See comment on FORMAT_NO_TIMESTAMP in types.ts
const config = pluginData.config.get();
const timestampFormat =
(config.format.timestamp !== FORMAT_NO_TIMESTAMP ? config.format.timestamp : null) ?? config.timestamp_format ?? undefined;
(config.format.timestamp !== FORMAT_NO_TIMESTAMP ? config.format.timestamp : null) ??
config.timestamp_format ??
undefined;
return log(
pluginData,

View file

@ -29,10 +29,12 @@ const MAX_BATCH_TIME = 5000;
type ZLogFormatsHelper = {
-readonly [K in keyof typeof LogType]: typeof zMessageContent;
};
export const zLogFormats = z.strictObject(keys(LogType).reduce((map, logType) => {
map[logType] = zMessageContent;
return map;
}, {} as ZLogFormatsHelper));
export const zLogFormats = z.strictObject(
keys(LogType).reduce((map, logType) => {
map[logType] = zMessageContent;
return map;
}, {} as ZLogFormatsHelper),
);
export type TLogFormats = z.infer<typeof zLogFormats>;
const zLogChannel = z.strictObject({
@ -58,10 +60,12 @@ export type TLogChannelMap = z.infer<typeof zLogChannelMap>;
export const zLogsConfig = z.strictObject({
channels: zLogChannelMap,
format: zLogFormats.merge(z.strictObject({
// Legacy/deprecated, use timestamp_format below instead
timestamp: zBoundedCharacters(0, 64).nullable(),
})),
format: zLogFormats.merge(
z.strictObject({
// Legacy/deprecated, use timestamp_format below instead
timestamp: zBoundedCharacters(0, 64).nullable(),
}),
),
// Legacy/deprecated, if below is false mentions wont actually ping. In case you really want the old behavior, set below to true
ping_user: z.boolean(),
allow_user_mentions: z.boolean(),

View file

@ -2,6 +2,10 @@ import { GuildPluginData } from "knub";
import { LogType } from "../../../data/LogType";
import { LogsPluginType } from "../types";
export function isLogIgnored(pluginData: GuildPluginData<LogsPluginType>, type: keyof typeof LogType, ignoreId: string) {
export function isLogIgnored(
pluginData: GuildPluginData<LogsPluginType>,
type: keyof typeof LogType,
ignoreId: string,
) {
return pluginData.state.guildLogs.isLogIgnored(type, ignoreId);
}