mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 13:01:36 +00:00
fix(discord): restrict activity types and statuses to valid enum values
- Removed 'offline' from valid config statuses (use 'invisible'). - Restricted activityType to 0, 1, 2, 3, 5 (excluding custom/4). - Added logic to only send 'url' when activityType is 1 (Streaming). - Updated Typescript definitions and Zod schemas to match.
This commit is contained in:
@@ -333,8 +333,10 @@ export const DiscordAccountSchema = z
|
||||
.optional(),
|
||||
responsePrefix: z.string().optional(),
|
||||
activity: z.string().optional(),
|
||||
status: z.enum(["online", "dnd", "idle", "invisible", "offline"]).optional(),
|
||||
activityType: z.number().int().min(0).max(5).optional(),
|
||||
status: z.enum(["online", "dnd", "idle", "invisible"]).optional(),
|
||||
activityType: z
|
||||
.union([z.literal(0), z.literal(1), z.literal(2), z.literal(3), z.literal(5)])
|
||||
.optional(),
|
||||
activityUrl: z.string().optional(),
|
||||
})
|
||||
.strict();
|
||||
|
||||
Reference in New Issue
Block a user