Skip to content

Commit

Permalink
feat(APIGuildForumChannel): add default_forum_layout (#658)
Browse files Browse the repository at this point in the history
* feat(APIGuildForumChannel): add `default_forum_layout`

* chore: use official names and text
  • Loading branch information
advaith1 committed Dec 15, 2022
1 parent 2b75d13 commit 190242a
Show file tree
Hide file tree
Showing 12 changed files with 128 additions and 8 deletions.
24 changes: 23 additions & 1 deletion deno/payloads/v10/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,24 @@ export enum SortOrderType {
CreationDate,
}

/**
* https://discord.com/developers/docs/resources/channel/#channel-object-forum-layout-types
*/
export enum ForumLayoutType {
/**
* No default has been set for forum channel
*/
NotSet,
/**
* Display posts as a list
*/
ListView,
/**
* Display posts as a collection of tiles
*/
GalleryView,
}

export interface APIGuildForumChannel extends APIGuildTextChannel<ChannelType.GuildForum> {
/**
* The set of tags that can be used in a forum channel
Expand All @@ -304,9 +322,13 @@ export interface APIGuildForumChannel extends APIGuildTextChannel<ChannelType.Gu
*/
default_reaction_emoji: APIGuildForumDefaultReactionEmoji | null;
/**
* The default sort order type used to order posts in forum channels
* The default sort order type used to order posts in a forum channel
*/
default_sort_order: SortOrderType | null;
/**
* The default layout type used to display posts in a forum channel. Defaults to `0`, which indicates a layout view has not been set by a channel admin
*/
default_forum_layout: ForumLayoutType;
}

/**
Expand Down
24 changes: 23 additions & 1 deletion deno/payloads/v9/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,24 @@ export enum SortOrderType {
CreationDate,
}

/**
* https://discord.com/developers/docs/resources/channel/#channel-object-forum-layout-types
*/
export enum ForumLayoutType {
/**
* No default has been set for forum channel
*/
NotSet,
/**
* Display posts as a list
*/
ListView,
/**
* Display posts as a collection of tiles
*/
GalleryView,
}

export interface APIGuildForumChannel extends APIGuildTextChannel<ChannelType.GuildForum> {
/**
* The set of tags that can be used in a forum channel
Expand All @@ -300,9 +318,13 @@ export interface APIGuildForumChannel extends APIGuildTextChannel<ChannelType.Gu
*/
default_reaction_emoji: APIGuildForumDefaultReactionEmoji | null;
/**
* The default sort order type used to order posts in forum channels
* The default sort order type used to order posts in a forum channel
*/
default_sort_order: SortOrderType | null;
/**
* The default layout type used to display posts in a forum channel. Defaults to `0`, which indicates a layout view has not been set by a channel admin
*/
default_forum_layout: ForumLayoutType;
}

/**
Expand Down
9 changes: 8 additions & 1 deletion deno/rest/v10/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import type {
APIGuildForumTag,
APIGuildForumDefaultReactionEmoji,
SortOrderType,
ForumLayoutType,
} from '../../payloads/v10/mod.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';

Expand Down Expand Up @@ -164,11 +165,17 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
*/
default_thread_rate_limit_per_user?: number | null;
/**
* The default sort order type used to order posts in forum channels
* The default sort order type used to order posts in a forum channel
*
* Channel types: forum
*/
default_sort_order?: SortOrderType | null;
/**
* The default layout type used to display posts in a forum channel
*
* Channel types: forum
*/
default_forum_layout?: ForumLayoutType;
}>;

/**
Expand Down
1 change: 1 addition & 0 deletions deno/rest/v10/guild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export type APIGuildCreatePartialChannel = StrictPartial<
| 'default_reaction_emoji'
| 'available_tags'
| 'default_sort_order'
| 'default_forum_layout'
>
> &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
Expand Down
9 changes: 8 additions & 1 deletion deno/rest/v9/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import type {
APIGuildForumTag,
APIGuildForumDefaultReactionEmoji,
SortOrderType,
ForumLayoutType,
} from '../../payloads/v9/mod.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';

Expand Down Expand Up @@ -164,11 +165,17 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
*/
default_thread_rate_limit_per_user?: number | null;
/**
* The default sort order type used to order posts in forum channels
* The default sort order type used to order posts in a forum channel
*
* Channel types: forum
*/
default_sort_order?: SortOrderType | null;
/**
* The default layout type used to display posts in a forum channel
*
* Channel types: forum
*/
default_forum_layout?: ForumLayoutType;
}>;

/**
Expand Down
1 change: 1 addition & 0 deletions deno/rest/v9/guild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export type APIGuildCreatePartialChannel = StrictPartial<
| 'default_reaction_emoji'
| 'available_tags'
| 'default_sort_order'
| 'default_forum_layout'
>
> &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
Expand Down
24 changes: 23 additions & 1 deletion payloads/v10/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,24 @@ export enum SortOrderType {
CreationDate,
}

/**
* https://discord.com/developers/docs/resources/channel/#channel-object-forum-layout-types
*/
export enum ForumLayoutType {
/**
* No default has been set for forum channel
*/
NotSet,
/**
* Display posts as a list
*/
ListView,
/**
* Display posts as a collection of tiles
*/
GalleryView,
}

export interface APIGuildForumChannel extends APIGuildTextChannel<ChannelType.GuildForum> {
/**
* The set of tags that can be used in a forum channel
Expand All @@ -304,9 +322,13 @@ export interface APIGuildForumChannel extends APIGuildTextChannel<ChannelType.Gu
*/
default_reaction_emoji: APIGuildForumDefaultReactionEmoji | null;
/**
* The default sort order type used to order posts in forum channels
* The default sort order type used to order posts in a forum channel
*/
default_sort_order: SortOrderType | null;
/**
* The default layout type used to display posts in a forum channel. Defaults to `0`, which indicates a layout view has not been set by a channel admin
*/
default_forum_layout: ForumLayoutType;
}

/**
Expand Down
24 changes: 23 additions & 1 deletion payloads/v9/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,24 @@ export enum SortOrderType {
CreationDate,
}

/**
* https://discord.com/developers/docs/resources/channel/#channel-object-forum-layout-types
*/
export enum ForumLayoutType {
/**
* No default has been set for forum channel
*/
NotSet,
/**
* Display posts as a list
*/
ListView,
/**
* Display posts as a collection of tiles
*/
GalleryView,
}

export interface APIGuildForumChannel extends APIGuildTextChannel<ChannelType.GuildForum> {
/**
* The set of tags that can be used in a forum channel
Expand All @@ -300,9 +318,13 @@ export interface APIGuildForumChannel extends APIGuildTextChannel<ChannelType.Gu
*/
default_reaction_emoji: APIGuildForumDefaultReactionEmoji | null;
/**
* The default sort order type used to order posts in forum channels
* The default sort order type used to order posts in a forum channel
*/
default_sort_order: SortOrderType | null;
/**
* The default layout type used to display posts in a forum channel. Defaults to `0`, which indicates a layout view has not been set by a channel admin
*/
default_forum_layout: ForumLayoutType;
}

/**
Expand Down
9 changes: 8 additions & 1 deletion rest/v10/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import type {
APIGuildForumTag,
APIGuildForumDefaultReactionEmoji,
SortOrderType,
ForumLayoutType,
} from '../../payloads/v10/index';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals';

Expand Down Expand Up @@ -164,11 +165,17 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
*/
default_thread_rate_limit_per_user?: number | null;
/**
* The default sort order type used to order posts in forum channels
* The default sort order type used to order posts in a forum channel
*
* Channel types: forum
*/
default_sort_order?: SortOrderType | null;
/**
* The default layout type used to display posts in a forum channel
*
* Channel types: forum
*/
default_forum_layout?: ForumLayoutType;
}>;

/**
Expand Down
1 change: 1 addition & 0 deletions rest/v10/guild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export type APIGuildCreatePartialChannel = StrictPartial<
| 'default_reaction_emoji'
| 'available_tags'
| 'default_sort_order'
| 'default_forum_layout'
>
> &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
Expand Down
9 changes: 8 additions & 1 deletion rest/v9/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import type {
APIGuildForumTag,
APIGuildForumDefaultReactionEmoji,
SortOrderType,
ForumLayoutType,
} from '../../payloads/v9/index';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals';

Expand Down Expand Up @@ -164,11 +165,17 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
*/
default_thread_rate_limit_per_user?: number | null;
/**
* The default sort order type used to order posts in forum channels
* The default sort order type used to order posts in a forum channel
*
* Channel types: forum
*/
default_sort_order?: SortOrderType | null;
/**
* The default layout type used to display posts in a forum channel
*
* Channel types: forum
*/
default_forum_layout?: ForumLayoutType;
}>;

/**
Expand Down
1 change: 1 addition & 0 deletions rest/v9/guild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export type APIGuildCreatePartialChannel = StrictPartial<
| 'default_reaction_emoji'
| 'available_tags'
| 'default_sort_order'
| 'default_forum_layout'
>
> &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
Expand Down

1 comment on commit 190242a

@vercel
Copy link

@vercel vercel bot commented on 190242a Dec 15, 2022

Choose a reason for hiding this comment

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

Please sign in to comment.