From 190242a59d5512fdc766217ec9f7c9c54a7b2dcb Mon Sep 17 00:00:00 2001 From: advaith Date: Wed, 14 Dec 2022 21:19:15 -0800 Subject: [PATCH] feat(APIGuildForumChannel): add `default_forum_layout` (#658) * feat(APIGuildForumChannel): add `default_forum_layout` * chore: use official names and text --- deno/payloads/v10/channel.ts | 24 +++++++++++++++++++++++- deno/payloads/v9/channel.ts | 24 +++++++++++++++++++++++- deno/rest/v10/channel.ts | 9 ++++++++- deno/rest/v10/guild.ts | 1 + deno/rest/v9/channel.ts | 9 ++++++++- deno/rest/v9/guild.ts | 1 + payloads/v10/channel.ts | 24 +++++++++++++++++++++++- payloads/v9/channel.ts | 24 +++++++++++++++++++++++- rest/v10/channel.ts | 9 ++++++++- rest/v10/guild.ts | 1 + rest/v9/channel.ts | 9 ++++++++- rest/v9/guild.ts | 1 + 12 files changed, 128 insertions(+), 8 deletions(-) diff --git a/deno/payloads/v10/channel.ts b/deno/payloads/v10/channel.ts index a67399ed..a090cdae 100644 --- a/deno/payloads/v10/channel.ts +++ b/deno/payloads/v10/channel.ts @@ -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 { /** * The set of tags that can be used in a forum channel @@ -304,9 +322,13 @@ export interface APIGuildForumChannel extends APIGuildTextChannel { /** * The set of tags that can be used in a forum channel @@ -300,9 +318,13 @@ export interface APIGuildForumChannel extends APIGuildTextChannel; /** diff --git a/deno/rest/v10/guild.ts b/deno/rest/v10/guild.ts index 195b5a9a..3899dfe1 100644 --- a/deno/rest/v10/guild.ts +++ b/deno/rest/v10/guild.ts @@ -56,6 +56,7 @@ export type APIGuildCreatePartialChannel = StrictPartial< | 'default_reaction_emoji' | 'available_tags' | 'default_sort_order' + | 'default_forum_layout' > > & AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{ diff --git a/deno/rest/v9/channel.ts b/deno/rest/v9/channel.ts index 5a62f442..cdb220c1 100644 --- a/deno/rest/v9/channel.ts +++ b/deno/rest/v9/channel.ts @@ -22,6 +22,7 @@ import type { APIGuildForumTag, APIGuildForumDefaultReactionEmoji, SortOrderType, + ForumLayoutType, } from '../../payloads/v9/mod.ts'; import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts'; @@ -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; }>; /** diff --git a/deno/rest/v9/guild.ts b/deno/rest/v9/guild.ts index 42bdea94..dfd18476 100644 --- a/deno/rest/v9/guild.ts +++ b/deno/rest/v9/guild.ts @@ -56,6 +56,7 @@ export type APIGuildCreatePartialChannel = StrictPartial< | 'default_reaction_emoji' | 'available_tags' | 'default_sort_order' + | 'default_forum_layout' > > & AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{ diff --git a/payloads/v10/channel.ts b/payloads/v10/channel.ts index 62c3a486..f7577672 100644 --- a/payloads/v10/channel.ts +++ b/payloads/v10/channel.ts @@ -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 { /** * The set of tags that can be used in a forum channel @@ -304,9 +322,13 @@ export interface APIGuildForumChannel extends APIGuildTextChannel { /** * The set of tags that can be used in a forum channel @@ -300,9 +318,13 @@ export interface APIGuildForumChannel extends APIGuildTextChannel; /** diff --git a/rest/v10/guild.ts b/rest/v10/guild.ts index 0af0d1d1..641d02c9 100644 --- a/rest/v10/guild.ts +++ b/rest/v10/guild.ts @@ -56,6 +56,7 @@ export type APIGuildCreatePartialChannel = StrictPartial< | 'default_reaction_emoji' | 'available_tags' | 'default_sort_order' + | 'default_forum_layout' > > & AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{ diff --git a/rest/v9/channel.ts b/rest/v9/channel.ts index 56d07520..3033abb5 100644 --- a/rest/v9/channel.ts +++ b/rest/v9/channel.ts @@ -22,6 +22,7 @@ import type { APIGuildForumTag, APIGuildForumDefaultReactionEmoji, SortOrderType, + ForumLayoutType, } from '../../payloads/v9/index'; import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals'; @@ -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; }>; /** diff --git a/rest/v9/guild.ts b/rest/v9/guild.ts index 8243c855..c0577d7d 100644 --- a/rest/v9/guild.ts +++ b/rest/v9/guild.ts @@ -56,6 +56,7 @@ export type APIGuildCreatePartialChannel = StrictPartial< | 'default_reaction_emoji' | 'available_tags' | 'default_sort_order' + | 'default_forum_layout' > > & AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{