From 08fb3fc5b566c7dd6d0848f31b0471d46594e9f1 Mon Sep 17 00:00:00 2001 From: ITOH Date: Wed, 29 Mar 2023 17:45:15 +0200 Subject: [PATCH] feat(client,types): add `FormLayout` enum (#2900) --- packages/client/src/typings.ts | 2 ++ packages/types/src/discord.ts | 5 ++++- packages/types/src/shared.ts | 9 +++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/packages/client/src/typings.ts b/packages/client/src/typings.ts index adc14dc82..91197af3d 100644 --- a/packages/client/src/typings.ts +++ b/packages/client/src/typings.ts @@ -8,6 +8,7 @@ import type { ChannelTypes, DefaultMessageNotificationLevels, ExplicitContentFilterLevels, + FormLayout, GuildFeatures, InteractionResponseTypes, MessageComponentTypes, @@ -256,6 +257,7 @@ export interface EditChannelOptions extends Omit ownerID?: string rtcRegion?: string | null videoQualityMode?: VideoQualityModes + defaultForumLayout: FormLayout } export interface EditChannelPositionOptions { lockPermissions?: string diff --git a/packages/types/src/discord.ts b/packages/types/src/discord.ts index 0aae9b0ea..a5831b6a2 100644 --- a/packages/types/src/discord.ts +++ b/packages/types/src/discord.ts @@ -13,6 +13,7 @@ import type { DefaultMessageNotificationLevels, EmbedTypes, ExplicitContentFilterLevels, + FormLayout, GatewayEventNames, GuildFeatures, GuildNsfwLevel, @@ -740,7 +741,7 @@ export interface DiscordChannel { /** the default sort order type used to order posts in GUILD_FORUM channels. Defaults to null, which indicates a preferred sort order hasn't been set by a channel admin */ default_sort_order?: SortOrderTypes | null /** the default forum layout view used to display posts in `GUILD_FORUM` channels. Defaults to `0`, which indicates a layout view has not been set by a channel admin */ - default_forum_layout?: number + default_forum_layout?: FormLayout /** When a thread is created this will be true on that channel payload for the thread. */ newly_created?: boolean } @@ -2396,6 +2397,8 @@ export interface DiscordModifyChannel { default_thread_rate_limit_per_user?: number /** the default sort order type used to order posts in forum channels */ default_sort_order?: SortOrderTypes | null + /** the default forum layout view used to display posts in `GUILD_FORUM` channels. Defaults to `0`, which indicates a layout view has not been set by a channel admin */ + default_forum_layout?: FormLayout } /** https://discord.com/developers/docs/resources/emoji#create-guild-emoji */ diff --git a/packages/types/src/shared.ts b/packages/types/src/shared.ts index a110d30ec..698b5a5a0 100644 --- a/packages/types/src/shared.ts +++ b/packages/types/src/shared.ts @@ -906,6 +906,15 @@ export enum SortOrderTypes { CreationDate, } +export enum FormLayout { + /** No default has been set for forum channel. */ + NotSet = 0, + /** Display posts as a list. */ + ListView = 1, + /** Display posts as a collection of tiles. */ + GalleryView = 2, +} + /** * https://discord.com/developers/docs/reference#image-formatting * json is only for stickers