Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/commands/setActivity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import {commandFactory} from '../utils/commandFactory';

export const SetActivity = Activity.pick({
state: true,
state_url: true,
details: true,
details_url: true,
timestamps: true,
assets: true,
party: true,
Expand Down
4 changes: 4 additions & 0 deletions src/schema/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ export const Activity = zod.object({
.nullable(),
application_id: zod.string().optional().nullable(),
details: zod.string().optional().nullable(),
details_url: zod.string().url().optional().nullable(),
state: zod.string().optional().nullable(),
state_url: zod.string().url().optional().nullable(),
emoji: Emoji.optional().nullable(),
party: zod
.object({
Expand All @@ -167,8 +169,10 @@ export const Activity = zod.object({
.object({
large_image: zod.string().nullable(),
large_text: zod.string().nullable(),
large_url: zod.string().url().optional().nullable(),
small_image: zod.string().nullable(),
small_text: zod.string().nullable(),
small_url: zod.string().url().optional().nullable(),
Comment on lines 170 to +175
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unsure if we want only the _url fields to be optional but idk why some fields are only nullable and some fields are optional + nullable in the existing code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i did optional + nullable to align with what details and state had -- i imagine the reason why large/small_image/text are nullable but not optional is that the intention is if (assets) { images & text should be defined }

})
.partial()
.optional()
Expand Down