@@ -10,13 +10,23 @@ import { zColor } from "../../utils/zColor.js";
1010
1111const caseKeys = keys ( CaseNameToType ) as U . ListOf < keyof typeof CaseNameToType > ;
1212
13+ const caseColorsTypeMap = caseKeys . reduce ( ( map , key ) => {
14+ map [ key ] = zColor ;
15+ return map ;
16+ } , { } as Record < typeof caseKeys [ number ] , typeof zColor > ) ;
17+
18+ const caseIconsTypeMap = caseKeys . reduce ( ( map , key ) => {
19+ map [ key ] = zBoundedCharacters ( 0 , 100 ) ;
20+ return map ;
21+ } , { } as Record < typeof caseKeys [ number ] , z . ZodString > ) ;
22+
1323export const zCasesConfig = z . strictObject ( {
1424 log_automatic_actions : z . boolean ( ) . default ( true ) ,
1525 case_log_channel : zSnowflake . nullable ( ) . default ( null ) ,
1626 show_relative_times : z . boolean ( ) . default ( true ) ,
1727 relative_time_cutoff : zDelayString . default ( "1w" ) ,
18- case_colors : z . record ( z . enum ( caseKeys ) , zColor ) . nullable ( ) . default ( null ) ,
19- case_icons : z . record ( z . enum ( caseKeys ) , zBoundedCharacters ( 0 , 100 ) ) . nullable ( ) . default ( null ) ,
28+ case_colors : z . strictObject ( caseColorsTypeMap ) . partial ( ) . nullable ( ) . default ( null ) ,
29+ case_icons : z . strictObject ( caseIconsTypeMap ) . partial ( ) . nullable ( ) . default ( null ) ,
2030} ) ;
2131
2232export interface CasesPluginType extends BasePluginType {
0 commit comments