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:
parent
77ab2718e7
commit
873bf7eb99
54 changed files with 462 additions and 416 deletions
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue