Skip to content

Commit

Permalink
refactor(APIGroupDMChannel): make name nullable (#347)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The `name` field is now also nullable for Group DM Channels
  • Loading branch information
almeidx committed Mar 29, 2022
1 parent 16a996d commit ed0049b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
6 changes: 5 additions & 1 deletion deno/payloads/v10/channel.ts
Expand Up @@ -165,7 +165,7 @@ interface APIDMChannelBase<T extends ChannelType> extends APITextBasedChannel<T>

export type APIDMChannel = APIDMChannelBase<ChannelType.DM>;

export interface APIGroupDMChannel extends APIDMChannelBase<ChannelType.GroupDM> {
export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.GroupDM>, 'name'> {
/**
* Application id of the group DM creator if it is bot-created
*/
Expand All @@ -174,6 +174,10 @@ export interface APIGroupDMChannel extends APIDMChannelBase<ChannelType.GroupDM>
* Icon hash
*/
icon?: string | null;
/**
* The name of the channel (2-100 characters)
*/
name?: string | null;
/**
* ID of the DM creator
*/
Expand Down
6 changes: 5 additions & 1 deletion deno/payloads/v9/channel.ts
Expand Up @@ -165,7 +165,7 @@ interface APIDMChannelBase<T extends ChannelType> extends APITextBasedChannel<T>

export type APIDMChannel = APIDMChannelBase<ChannelType.DM>;

export interface APIGroupDMChannel extends APIDMChannelBase<ChannelType.GroupDM> {
export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.GroupDM>, 'name'> {
/**
* Application id of the group DM creator if it is bot-created
*/
Expand All @@ -174,6 +174,10 @@ export interface APIGroupDMChannel extends APIDMChannelBase<ChannelType.GroupDM>
* Icon hash
*/
icon?: string | null;
/**
* The name of the channel (2-100 characters)
*/
name?: string | null;
/**
* ID of the DM creator
*/
Expand Down
6 changes: 5 additions & 1 deletion payloads/v10/channel.ts
Expand Up @@ -165,7 +165,7 @@ interface APIDMChannelBase<T extends ChannelType> extends APITextBasedChannel<T>

export type APIDMChannel = APIDMChannelBase<ChannelType.DM>;

export interface APIGroupDMChannel extends APIDMChannelBase<ChannelType.GroupDM> {
export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.GroupDM>, 'name'> {
/**
* Application id of the group DM creator if it is bot-created
*/
Expand All @@ -174,6 +174,10 @@ export interface APIGroupDMChannel extends APIDMChannelBase<ChannelType.GroupDM>
* Icon hash
*/
icon?: string | null;
/**
* The name of the channel (2-100 characters)
*/
name?: string | null;
/**
* ID of the DM creator
*/
Expand Down
6 changes: 5 additions & 1 deletion payloads/v9/channel.ts
Expand Up @@ -165,7 +165,7 @@ interface APIDMChannelBase<T extends ChannelType> extends APITextBasedChannel<T>

export type APIDMChannel = APIDMChannelBase<ChannelType.DM>;

export interface APIGroupDMChannel extends APIDMChannelBase<ChannelType.GroupDM> {
export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.GroupDM>, 'name'> {
/**
* Application id of the group DM creator if it is bot-created
*/
Expand All @@ -174,6 +174,10 @@ export interface APIGroupDMChannel extends APIDMChannelBase<ChannelType.GroupDM>
* Icon hash
*/
icon?: string | null;
/**
* The name of the channel (2-100 characters)
*/
name?: string | null;
/**
* ID of the DM creator
*/
Expand Down

0 comments on commit ed0049b

Please sign in to comment.