Add commenter targeting mode

This commit is contained in:
Jamie Brunton committed 2026-08-14 08:51:27 +01:00
1 parent 0dfdda61fd
commit e9a4c965ee
23 files changed
+374 -10

No files matched your search

+9
View File
@@ -53,10 +53,19 @@ export const SubredditConfigSchema = z.strictObject({
name: z.string(),
enabled: z.boolean().default(true),
type: z.union([z.literal('image'), z.literal('chat')]),
targetingMode: z.union([z.literal('post-author'), z.literal('comment-author')]).default('post-author'),
weight: z.number().optional(),
tone: ToneKeySchema,
scripted: z.string().optional(),
conversation: ConversationBehaviourSchema,
}).superRefine((subreddit, context) => {
if (subreddit.type === 'chat' && subreddit.targetingMode === 'comment-author') {
context.addIssue({
code: 'custom',
path: ['targetingMode'],
message: 'Comment-author targeting is available only for image posts.',
});
}
});
export const ConfigResponseSchema = RuntimeConfigSchema.extend({
subreddits: z.array(SubredditConfigSchema),