Skip to content

Commit

Permalink
refactor: make things optional and nullable where applicable (#361)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The deprecated `asset` field for stickers is correctly marked as optional now. The `image` field for Guild Scheduled Events is now correctly typed as optional.
  • Loading branch information
almeidx committed Mar 9, 2022
1 parent fddff21 commit 10fdeaa
Show file tree
Hide file tree
Showing 12 changed files with 40 additions and 8 deletions.
2 changes: 1 addition & 1 deletion deno/payloads/v10/guildScheduledEvent.ts
Expand Up @@ -66,7 +66,7 @@ interface APIGuildScheduledEventBase<Type extends GuildScheduledEventEntityType>
/**
* The cover image of the scheduled event
*/
image: string | null;
image?: string | null;
}

export interface APIStageInstanceGuildScheduledEvent
Expand Down
2 changes: 1 addition & 1 deletion deno/payloads/v10/sticker.ts
Expand Up @@ -33,7 +33,7 @@ export interface APISticker {
* Previously the sticker asset hash, now an empty string
* @deprecated
*/
asset: '';
asset?: '';
/**
* Type of sticker
*
Expand Down
2 changes: 1 addition & 1 deletion deno/payloads/v9/guildScheduledEvent.ts
Expand Up @@ -66,7 +66,7 @@ interface APIGuildScheduledEventBase<Type extends GuildScheduledEventEntityType>
/**
* The cover image of the scheduled event
*/
image: string | null;
image?: string | null;
}

export interface APIStageInstanceGuildScheduledEvent
Expand Down
2 changes: 1 addition & 1 deletion deno/payloads/v9/sticker.ts
Expand Up @@ -33,7 +33,7 @@ export interface APISticker {
* Previously the sticker asset hash, now an empty string
* @deprecated
*/
asset: '';
asset?: '';
/**
* Type of sticker
*
Expand Down
8 changes: 8 additions & 0 deletions deno/rest/v10/guildScheduledEvent.ts
Expand Up @@ -95,6 +95,14 @@ export type RESTPatchAPIGuildScheduledEventJSONBody = StrictPartial<RESTPostAPIG
* The status of the scheduled event
*/
status?: GuildScheduledEventStatus;
/**
* The entity metadata of the scheduled event
*/
entity_metadata?: APIGuildScheduledEventEntityMetadata | null;
/**
* The description of the guild event
*/
description?: string | null;
}>;

/**
Expand Down
8 changes: 8 additions & 0 deletions deno/rest/v9/guildScheduledEvent.ts
Expand Up @@ -95,6 +95,14 @@ export type RESTPatchAPIGuildScheduledEventJSONBody = StrictPartial<RESTPostAPIG
* The status of the scheduled event
*/
status?: GuildScheduledEventStatus;
/**
* The entity metadata of the scheduled event
*/
entity_metadata?: APIGuildScheduledEventEntityMetadata | null;
/**
* The description of the guild event
*/
description?: string | null;
}>;

/**
Expand Down
2 changes: 1 addition & 1 deletion payloads/v10/guildScheduledEvent.ts
Expand Up @@ -66,7 +66,7 @@ interface APIGuildScheduledEventBase<Type extends GuildScheduledEventEntityType>
/**
* The cover image of the scheduled event
*/
image: string | null;
image?: string | null;
}

export interface APIStageInstanceGuildScheduledEvent
Expand Down
2 changes: 1 addition & 1 deletion payloads/v10/sticker.ts
Expand Up @@ -33,7 +33,7 @@ export interface APISticker {
* Previously the sticker asset hash, now an empty string
* @deprecated
*/
asset: '';
asset?: '';
/**
* Type of sticker
*
Expand Down
2 changes: 1 addition & 1 deletion payloads/v9/guildScheduledEvent.ts
Expand Up @@ -66,7 +66,7 @@ interface APIGuildScheduledEventBase<Type extends GuildScheduledEventEntityType>
/**
* The cover image of the scheduled event
*/
image: string | null;
image?: string | null;
}

export interface APIStageInstanceGuildScheduledEvent
Expand Down
2 changes: 1 addition & 1 deletion payloads/v9/sticker.ts
Expand Up @@ -33,7 +33,7 @@ export interface APISticker {
* Previously the sticker asset hash, now an empty string
* @deprecated
*/
asset: '';
asset?: '';
/**
* Type of sticker
*
Expand Down
8 changes: 8 additions & 0 deletions rest/v10/guildScheduledEvent.ts
Expand Up @@ -95,6 +95,14 @@ export type RESTPatchAPIGuildScheduledEventJSONBody = StrictPartial<RESTPostAPIG
* The status of the scheduled event
*/
status?: GuildScheduledEventStatus;
/**
* The entity metadata of the scheduled event
*/
entity_metadata?: APIGuildScheduledEventEntityMetadata | null;
/**
* The description of the guild event
*/
description?: string | null;
}>;

/**
Expand Down
8 changes: 8 additions & 0 deletions rest/v9/guildScheduledEvent.ts
Expand Up @@ -95,6 +95,14 @@ export type RESTPatchAPIGuildScheduledEventJSONBody = StrictPartial<RESTPostAPIG
* The status of the scheduled event
*/
status?: GuildScheduledEventStatus;
/**
* The entity metadata of the scheduled event
*/
entity_metadata?: APIGuildScheduledEventEntityMetadata | null;
/**
* The description of the guild event
*/
description?: string | null;
}>;

/**
Expand Down

0 comments on commit 10fdeaa

Please sign in to comment.