3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-07-08 03:27:20 +00:00

refactor: move defaults to config schemas

This commit is contained in:
Dragory 2025-05-23 01:12:52 +00:00
parent 09eb8e92f2
commit 83d35052c3
No known key found for this signature in database
91 changed files with 450 additions and 888 deletions

View file

@ -6,11 +6,11 @@ import { CommonPlugin } from "../Common/CommonPlugin.js";
import { NamesCmd } from "./commands/NamesCmd.js";
import { NameHistoryPluginType, zNameHistoryConfig } from "./types.js";
const defaultOptions: PluginOptions<NameHistoryPluginType> = {
config: {
can_view: false,
},
overrides: [
export const NameHistoryPlugin = guildPlugin<NameHistoryPluginType>()({
name: "name_history",
configSchema: zNameHistoryConfig,
defaultOverrides: [
{
level: ">=50",
config: {
@ -18,13 +18,6 @@ const defaultOptions: PluginOptions<NameHistoryPluginType> = {
},
},
],
};
export const NameHistoryPlugin = guildPlugin<NameHistoryPluginType>()({
name: "name_history",
configParser: (input) => zNameHistoryConfig.parse(input),
defaultOptions,
// prettier-ignore
messageCommands: [

View file

@ -6,11 +6,11 @@ import { UsernameHistory } from "../../data/UsernameHistory.js";
import { CommonPlugin } from "../Common/CommonPlugin.js";
export const zNameHistoryConfig = z.strictObject({
can_view: z.boolean(),
can_view: z.boolean().default(false),
});
export interface NameHistoryPluginType extends BasePluginType {
config: z.infer<typeof zNameHistoryConfig>;
configSchema: typeof zNameHistoryConfig;
state: {
nicknameHistory: GuildNicknameHistory;
usernameHistory: UsernameHistory;