mirror of
https://github.com/discordjs/discord-api-types.git
synced 2026-06-01 08:20:10 +00:00
refactor: make things optional and nullable where applicable (#361)
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.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -33,7 +33,7 @@ export interface APISticker {
|
||||
* Previously the sticker asset hash, now an empty string
|
||||
* @deprecated
|
||||
*/
|
||||
asset: '';
|
||||
asset?: '';
|
||||
/**
|
||||
* Type of sticker
|
||||
*
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -33,7 +33,7 @@ export interface APISticker {
|
||||
* Previously the sticker asset hash, now an empty string
|
||||
* @deprecated
|
||||
*/
|
||||
asset: '';
|
||||
asset?: '';
|
||||
/**
|
||||
* Type of sticker
|
||||
*
|
||||
|
||||
@@ -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;
|
||||
}>;
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
}>;
|
||||
|
||||
/**
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -33,7 +33,7 @@ export interface APISticker {
|
||||
* Previously the sticker asset hash, now an empty string
|
||||
* @deprecated
|
||||
*/
|
||||
asset: '';
|
||||
asset?: '';
|
||||
/**
|
||||
* Type of sticker
|
||||
*
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -33,7 +33,7 @@ export interface APISticker {
|
||||
* Previously the sticker asset hash, now an empty string
|
||||
* @deprecated
|
||||
*/
|
||||
asset: '';
|
||||
asset?: '';
|
||||
/**
|
||||
* Type of sticker
|
||||
*
|
||||
|
||||
@@ -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;
|
||||
}>;
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
}>;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user