From 143b003fbe5a86eda225e9da1d0914d6e48cddfd Mon Sep 17 00:00:00 2001 From: Almeida Date: Sun, 25 Sep 2022 18:42:38 +0100 Subject: [PATCH] feat(APIGuildForumChannel): add `default_sort_order` (#589) --- deno/payloads/v10/channel.ts | 18 ++++++++++++++++++ deno/payloads/v9/channel.ts | 18 ++++++++++++++++++ deno/rest/v10/channel.ts | 7 +++++++ deno/rest/v10/guild.ts | 1 + deno/rest/v9/channel.ts | 7 +++++++ deno/rest/v9/guild.ts | 1 + payloads/v10/channel.ts | 18 ++++++++++++++++++ payloads/v9/channel.ts | 18 ++++++++++++++++++ rest/v10/channel.ts | 7 +++++++ rest/v10/guild.ts | 1 + rest/v9/channel.ts | 7 +++++++ rest/v9/guild.ts | 1 + 12 files changed, 104 insertions(+) diff --git a/deno/payloads/v10/channel.ts b/deno/payloads/v10/channel.ts index 02234325b..40cfaedfe 100644 --- a/deno/payloads/v10/channel.ts +++ b/deno/payloads/v10/channel.ts @@ -276,6 +276,20 @@ export interface APIGuildForumDefaultReactionEmoji { emoji_name: string | null; } +/** + * https://discord.com/developers/docs/resources/channel/#channel-object-sort-order-types + */ +export enum SortOrderType { + /** + * Sort forum posts by activity + */ + LatestActivity, + /** + * Sort forum posts by creation time (from most recent to oldest) + */ + CreationDate, +} + export interface APIGuildForumChannel extends APIGuildTextChannel { /** * The set of tags that can be used in a forum channel @@ -290,6 +304,10 @@ export interface APIGuildForumChannel extends APIGuildTextChannel { /** * The set of tags that can be used in a forum channel @@ -290,6 +304,10 @@ export interface APIGuildForumChannel extends APIGuildTextChannel; /** diff --git a/deno/rest/v10/guild.ts b/deno/rest/v10/guild.ts index ade857a99..eee777ae1 100644 --- a/deno/rest/v10/guild.ts +++ b/deno/rest/v10/guild.ts @@ -55,6 +55,7 @@ export type APIGuildCreatePartialChannel = StrictPartial< | 'flags' | 'default_reaction_emoji' | 'available_tags' + | 'default_sort_order' > > & AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{ diff --git a/deno/rest/v9/channel.ts b/deno/rest/v9/channel.ts index 1527cee17..de5dbbae4 100644 --- a/deno/rest/v9/channel.ts +++ b/deno/rest/v9/channel.ts @@ -21,6 +21,7 @@ import type { VideoQualityMode, APIGuildForumTag, APIGuildForumDefaultReactionEmoji, + SortOrderType, } from '../../payloads/v9/mod.ts'; import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts'; @@ -162,6 +163,12 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert * Channel types: text, forum */ default_thread_rate_limit_per_user?: number | null; + /** + * The default sort order type used to order posts in forum channels + * + * Channel types: forum + */ + default_sort_order?: SortOrderType | null; }>; /** diff --git a/deno/rest/v9/guild.ts b/deno/rest/v9/guild.ts index 25b393f1a..40a9dc318 100644 --- a/deno/rest/v9/guild.ts +++ b/deno/rest/v9/guild.ts @@ -55,6 +55,7 @@ export type APIGuildCreatePartialChannel = StrictPartial< | 'flags' | 'default_reaction_emoji' | 'available_tags' + | 'default_sort_order' > > & AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{ diff --git a/payloads/v10/channel.ts b/payloads/v10/channel.ts index 35cf36963..d743ac644 100644 --- a/payloads/v10/channel.ts +++ b/payloads/v10/channel.ts @@ -276,6 +276,20 @@ export interface APIGuildForumDefaultReactionEmoji { emoji_name: string | null; } +/** + * https://discord.com/developers/docs/resources/channel/#channel-object-sort-order-types + */ +export enum SortOrderType { + /** + * Sort forum posts by activity + */ + LatestActivity, + /** + * Sort forum posts by creation time (from most recent to oldest) + */ + CreationDate, +} + export interface APIGuildForumChannel extends APIGuildTextChannel { /** * The set of tags that can be used in a forum channel @@ -290,6 +304,10 @@ export interface APIGuildForumChannel extends APIGuildTextChannel { /** * The set of tags that can be used in a forum channel @@ -290,6 +304,10 @@ export interface APIGuildForumChannel extends APIGuildTextChannel; /** diff --git a/rest/v10/guild.ts b/rest/v10/guild.ts index 1b7af3c52..415d3a8f8 100644 --- a/rest/v10/guild.ts +++ b/rest/v10/guild.ts @@ -55,6 +55,7 @@ export type APIGuildCreatePartialChannel = StrictPartial< | 'flags' | 'default_reaction_emoji' | 'available_tags' + | 'default_sort_order' > > & AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{ diff --git a/rest/v9/channel.ts b/rest/v9/channel.ts index ed428aa3d..f79b905c7 100644 --- a/rest/v9/channel.ts +++ b/rest/v9/channel.ts @@ -21,6 +21,7 @@ import type { VideoQualityMode, APIGuildForumTag, APIGuildForumDefaultReactionEmoji, + SortOrderType, } from '../../payloads/v9/index'; import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals'; @@ -162,6 +163,12 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert * Channel types: text, forum */ default_thread_rate_limit_per_user?: number | null; + /** + * The default sort order type used to order posts in forum channels + * + * Channel types: forum + */ + default_sort_order?: SortOrderType | null; }>; /** diff --git a/rest/v9/guild.ts b/rest/v9/guild.ts index 88c23ca2c..70d6f0993 100644 --- a/rest/v9/guild.ts +++ b/rest/v9/guild.ts @@ -55,6 +55,7 @@ export type APIGuildCreatePartialChannel = StrictPartial< | 'flags' | 'default_reaction_emoji' | 'available_tags' + | 'default_sort_order' > > & AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{