diff --git a/deno/rest/v10/channel.ts b/deno/rest/v10/channel.ts index 97a8dd78..ec1fed14 100644 --- a/deno/rest/v10/channel.ts +++ b/deno/rest/v10/channel.ts @@ -713,7 +713,7 @@ export type RESTPutAPIChannelRecipientResult = unknown; export type RESTDeleteAPIChannelRecipientResult = unknown; /** - * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-from-message} + * @see {@link https://docs.discord.com/developers/resources/channel#start-thread-from-message} */ export interface RESTPostAPIChannelMessagesThreadsJSONBody { /** @@ -731,40 +731,15 @@ export interface RESTPostAPIChannelMessagesThreadsJSONBody { } /** - * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-in-forum-or-media-channel} + * @see {@link https://docs.discord.com/developers/resources/channel#start-thread-from-message} */ -export type RESTPostAPIGuildForumThreadsJSONBody = RESTPostAPIChannelMessagesThreadsJSONBody & { - /** - * The initial message of the thread - */ - message: RESTPostAPIChannelMessageJSONBody; - /** - * The IDs of the set of tags to apply to the thread; limited to 5 - */ - applied_tags?: Snowflake[] | undefined; -}; +export type RESTPostAPIChannelMessagesThreadsResult = + | APIAnnouncementThreadChannel + | APIPrivateThreadChannel + | APIPublicThreadChannel; /** - * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-in-forum-or-media-channel} - */ -export type RESTPostAPIGuildForumThreadsFormDataBody = RESTPostAPIChannelMessagesThreadsJSONBody & { - /** - * The initial message of the thread - */ - message: string; - /** - * The IDs of the set of tags to apply to the thread; limited to 5 - */ - applied_tags?: Snowflake[] | undefined; -}; - -/** - * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-from-message} - */ -export type RESTPostAPIChannelMessagesThreadsResult = APIChannel; - -/** - * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-without-message} + * @see {@link https://docs.discord.com/developers/resources/channel#start-thread-without-message} */ export interface RESTPostAPIChannelThreadsJSONBody extends RESTPostAPIChannelMessagesThreadsJSONBody { /** @@ -782,13 +757,59 @@ export interface RESTPostAPIChannelThreadsJSONBody extends RESTPostAPIChannelMes } /** - * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-without-message} + * @see {@link https://docs.discord.com/developers/resources/channel#start-thread-without-message} */ export type RESTPostAPIChannelThreadsResult = | APIAnnouncementThreadChannel | APIPrivateThreadChannel | APIPublicThreadChannel; +/** + * @see {@link https://docs.discord.com/developers/resources/channel#start-thread-in-forum-or-media-channel-forum-and-media-thread-message-params-object} + */ +export type RESTAPIForumThreadMessageParams = Pick< + RESTPostAPIChannelMessageJSONBody, + 'allowed_mentions' | 'attachments' | 'components' | 'content' | 'embeds' | 'flags' | 'sticker_ids' +>; + +/** + * @see {@link https://docs.discord.com/developers/resources/channel#start-thread-in-forum-or-media-channel} + */ +export type RESTPostAPIGuildForumThreadsJSONBody = RESTPostAPIChannelMessagesThreadsJSONBody & { + /** + * The initial message of the thread + */ + message: RESTAPIForumThreadMessageParams; + /** + * The IDs of the set of tags to apply to the thread; limited to 5 + */ + applied_tags?: Snowflake[] | undefined; +}; + +/** + * @see {@link https://docs.discord.com/developers/resources/channel#start-thread-in-forum-or-media-channel} + */ +export type RESTPostAPIGuildForumThreadsFormDataBody = RESTPostAPIChannelMessagesThreadsJSONBody & { + /** + * The initial message of the thread + */ + message: string; + /** + * The IDs of the set of tags to apply to the thread; limited to 5 + */ + applied_tags?: Snowflake[] | undefined; +}; + +/** + * @see {@link https://docs.discord.com/developers/resources/channel#start-thread-in-forum-or-media-channel} + */ +export interface RESTPostAPIGuildForumThreadsResult extends APIPublicThreadChannel { + /** + * The message that was created with the thread + */ + message: APIMessage; +} + /** * @see {@link https://discord.com/developers/docs/resources/channel#join-thread} */ diff --git a/deno/rest/v9/channel.ts b/deno/rest/v9/channel.ts index 5275fab0..1b80fe0c 100644 --- a/deno/rest/v9/channel.ts +++ b/deno/rest/v9/channel.ts @@ -726,7 +726,7 @@ export type RESTPutAPIChannelRecipientResult = unknown; export type RESTDeleteAPIChannelRecipientResult = unknown; /** - * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-from-message} + * @see {@link https://docs.discord.com/developers/resources/channel#start-thread-from-message} */ export interface RESTPostAPIChannelMessagesThreadsJSONBody { /** @@ -744,40 +744,15 @@ export interface RESTPostAPIChannelMessagesThreadsJSONBody { } /** - * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-in-forum-or-media-channel} + * @see {@link https://docs.discord.com/developers/resources/channel#start-thread-from-message} */ -export type RESTPostAPIGuildForumThreadsJSONBody = RESTPostAPIChannelMessagesThreadsJSONBody & { - /** - * The initial message of the thread - */ - message: RESTPostAPIChannelMessageJSONBody; - /** - * The IDs of the set of tags to apply to the thread; limited to 5 - */ - applied_tags?: Snowflake[] | undefined; -}; +export type RESTPostAPIChannelMessagesThreadsResult = + | APIAnnouncementThreadChannel + | APIPrivateThreadChannel + | APIPublicThreadChannel; /** - * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-in-forum-or-media-channel} - */ -export type RESTPostAPIGuildForumThreadsFormDataBody = RESTPostAPIChannelMessagesThreadsJSONBody & { - /** - * The initial message of the thread - */ - message: string; - /** - * The IDs of the set of tags to apply to the thread; limited to 5 - */ - applied_tags?: Snowflake[] | undefined; -}; - -/** - * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-from-message} - */ -export type RESTPostAPIChannelMessagesThreadsResult = APIChannel; - -/** - * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-without-message} + * @see {@link https://docs.discord.com/developers/resources/channel#start-thread-without-message} */ export interface RESTPostAPIChannelThreadsJSONBody extends RESTPostAPIChannelMessagesThreadsJSONBody { /** @@ -795,13 +770,59 @@ export interface RESTPostAPIChannelThreadsJSONBody extends RESTPostAPIChannelMes } /** - * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-without-message} + * @see {@link https://docs.discord.com/developers/resources/channel#start-thread-without-message} */ export type RESTPostAPIChannelThreadsResult = | APIAnnouncementThreadChannel | APIPrivateThreadChannel | APIPublicThreadChannel; +/** + * @see {@link https://docs.discord.com/developers/resources/channel#start-thread-in-forum-or-media-channel-forum-and-media-thread-message-params-object} + */ +export type RESTAPIForumThreadMessageParams = Pick< + RESTPostAPIChannelMessageJSONBody, + 'allowed_mentions' | 'attachments' | 'components' | 'content' | 'embeds' | 'flags' | 'sticker_ids' +>; + +/** + * @see {@link https://docs.discord.com/developers/resources/channel#start-thread-in-forum-or-media-channel} + */ +export type RESTPostAPIGuildForumThreadsJSONBody = RESTPostAPIChannelMessagesThreadsJSONBody & { + /** + * The initial message of the thread + */ + message: RESTAPIForumThreadMessageParams; + /** + * The IDs of the set of tags to apply to the thread; limited to 5 + */ + applied_tags?: Snowflake[] | undefined; +}; + +/** + * @see {@link https://docs.discord.com/developers/resources/channel#start-thread-in-forum-or-media-channel} + */ +export type RESTPostAPIGuildForumThreadsFormDataBody = RESTPostAPIChannelMessagesThreadsJSONBody & { + /** + * The initial message of the thread + */ + message: string; + /** + * The IDs of the set of tags to apply to the thread; limited to 5 + */ + applied_tags?: Snowflake[] | undefined; +}; + +/** + * @see {@link https://docs.discord.com/developers/resources/channel#start-thread-in-forum-or-media-channel} + */ +export interface RESTPostAPIGuildForumThreadsResult extends APIPublicThreadChannel { + /** + * The message that was created with the thread + */ + message: APIMessage; +} + /** * @see {@link https://discord.com/developers/docs/resources/channel#join-thread} */ diff --git a/eslint.config.ts b/eslint.config.ts index 2e508570..089038c0 100644 --- a/eslint.config.ts +++ b/eslint.config.ts @@ -309,6 +309,7 @@ export default config([ 'RESTAPIInteractionCallbackObject', 'RESTAPIInteractionCallbackResourceObject', 'RESTAPIMessageReference', + 'RESTAPIForumThreadMessageParams', 'RESTAPIPartialCurrentUserGuild', 'RESTAPIPoll', 'RESTOAuth2TokenOptionalClientCredentials', diff --git a/rest/v10/channel.ts b/rest/v10/channel.ts index 5bb9fe42..e21a39ed 100644 --- a/rest/v10/channel.ts +++ b/rest/v10/channel.ts @@ -713,7 +713,7 @@ export type RESTPutAPIChannelRecipientResult = unknown; export type RESTDeleteAPIChannelRecipientResult = unknown; /** - * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-from-message} + * @see {@link https://docs.discord.com/developers/resources/channel#start-thread-from-message} */ export interface RESTPostAPIChannelMessagesThreadsJSONBody { /** @@ -731,40 +731,15 @@ export interface RESTPostAPIChannelMessagesThreadsJSONBody { } /** - * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-in-forum-or-media-channel} + * @see {@link https://docs.discord.com/developers/resources/channel#start-thread-from-message} */ -export type RESTPostAPIGuildForumThreadsJSONBody = RESTPostAPIChannelMessagesThreadsJSONBody & { - /** - * The initial message of the thread - */ - message: RESTPostAPIChannelMessageJSONBody; - /** - * The IDs of the set of tags to apply to the thread; limited to 5 - */ - applied_tags?: Snowflake[] | undefined; -}; +export type RESTPostAPIChannelMessagesThreadsResult = + | APIAnnouncementThreadChannel + | APIPrivateThreadChannel + | APIPublicThreadChannel; /** - * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-in-forum-or-media-channel} - */ -export type RESTPostAPIGuildForumThreadsFormDataBody = RESTPostAPIChannelMessagesThreadsJSONBody & { - /** - * The initial message of the thread - */ - message: string; - /** - * The IDs of the set of tags to apply to the thread; limited to 5 - */ - applied_tags?: Snowflake[] | undefined; -}; - -/** - * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-from-message} - */ -export type RESTPostAPIChannelMessagesThreadsResult = APIChannel; - -/** - * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-without-message} + * @see {@link https://docs.discord.com/developers/resources/channel#start-thread-without-message} */ export interface RESTPostAPIChannelThreadsJSONBody extends RESTPostAPIChannelMessagesThreadsJSONBody { /** @@ -782,13 +757,59 @@ export interface RESTPostAPIChannelThreadsJSONBody extends RESTPostAPIChannelMes } /** - * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-without-message} + * @see {@link https://docs.discord.com/developers/resources/channel#start-thread-without-message} */ export type RESTPostAPIChannelThreadsResult = | APIAnnouncementThreadChannel | APIPrivateThreadChannel | APIPublicThreadChannel; +/** + * @see {@link https://docs.discord.com/developers/resources/channel#start-thread-in-forum-or-media-channel-forum-and-media-thread-message-params-object} + */ +export type RESTAPIForumThreadMessageParams = Pick< + RESTPostAPIChannelMessageJSONBody, + 'allowed_mentions' | 'attachments' | 'components' | 'content' | 'embeds' | 'flags' | 'sticker_ids' +>; + +/** + * @see {@link https://docs.discord.com/developers/resources/channel#start-thread-in-forum-or-media-channel} + */ +export type RESTPostAPIGuildForumThreadsJSONBody = RESTPostAPIChannelMessagesThreadsJSONBody & { + /** + * The initial message of the thread + */ + message: RESTAPIForumThreadMessageParams; + /** + * The IDs of the set of tags to apply to the thread; limited to 5 + */ + applied_tags?: Snowflake[] | undefined; +}; + +/** + * @see {@link https://docs.discord.com/developers/resources/channel#start-thread-in-forum-or-media-channel} + */ +export type RESTPostAPIGuildForumThreadsFormDataBody = RESTPostAPIChannelMessagesThreadsJSONBody & { + /** + * The initial message of the thread + */ + message: string; + /** + * The IDs of the set of tags to apply to the thread; limited to 5 + */ + applied_tags?: Snowflake[] | undefined; +}; + +/** + * @see {@link https://docs.discord.com/developers/resources/channel#start-thread-in-forum-or-media-channel} + */ +export interface RESTPostAPIGuildForumThreadsResult extends APIPublicThreadChannel { + /** + * The message that was created with the thread + */ + message: APIMessage; +} + /** * @see {@link https://discord.com/developers/docs/resources/channel#join-thread} */ diff --git a/rest/v9/channel.ts b/rest/v9/channel.ts index a20226da..b9e3f40f 100644 --- a/rest/v9/channel.ts +++ b/rest/v9/channel.ts @@ -726,7 +726,7 @@ export type RESTPutAPIChannelRecipientResult = unknown; export type RESTDeleteAPIChannelRecipientResult = unknown; /** - * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-from-message} + * @see {@link https://docs.discord.com/developers/resources/channel#start-thread-from-message} */ export interface RESTPostAPIChannelMessagesThreadsJSONBody { /** @@ -744,40 +744,15 @@ export interface RESTPostAPIChannelMessagesThreadsJSONBody { } /** - * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-in-forum-or-media-channel} + * @see {@link https://docs.discord.com/developers/resources/channel#start-thread-from-message} */ -export type RESTPostAPIGuildForumThreadsJSONBody = RESTPostAPIChannelMessagesThreadsJSONBody & { - /** - * The initial message of the thread - */ - message: RESTPostAPIChannelMessageJSONBody; - /** - * The IDs of the set of tags to apply to the thread; limited to 5 - */ - applied_tags?: Snowflake[] | undefined; -}; +export type RESTPostAPIChannelMessagesThreadsResult = + | APIAnnouncementThreadChannel + | APIPrivateThreadChannel + | APIPublicThreadChannel; /** - * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-in-forum-or-media-channel} - */ -export type RESTPostAPIGuildForumThreadsFormDataBody = RESTPostAPIChannelMessagesThreadsJSONBody & { - /** - * The initial message of the thread - */ - message: string; - /** - * The IDs of the set of tags to apply to the thread; limited to 5 - */ - applied_tags?: Snowflake[] | undefined; -}; - -/** - * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-from-message} - */ -export type RESTPostAPIChannelMessagesThreadsResult = APIChannel; - -/** - * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-without-message} + * @see {@link https://docs.discord.com/developers/resources/channel#start-thread-without-message} */ export interface RESTPostAPIChannelThreadsJSONBody extends RESTPostAPIChannelMessagesThreadsJSONBody { /** @@ -795,13 +770,59 @@ export interface RESTPostAPIChannelThreadsJSONBody extends RESTPostAPIChannelMes } /** - * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-without-message} + * @see {@link https://docs.discord.com/developers/resources/channel#start-thread-without-message} */ export type RESTPostAPIChannelThreadsResult = | APIAnnouncementThreadChannel | APIPrivateThreadChannel | APIPublicThreadChannel; +/** + * @see {@link https://docs.discord.com/developers/resources/channel#start-thread-in-forum-or-media-channel-forum-and-media-thread-message-params-object} + */ +export type RESTAPIForumThreadMessageParams = Pick< + RESTPostAPIChannelMessageJSONBody, + 'allowed_mentions' | 'attachments' | 'components' | 'content' | 'embeds' | 'flags' | 'sticker_ids' +>; + +/** + * @see {@link https://docs.discord.com/developers/resources/channel#start-thread-in-forum-or-media-channel} + */ +export type RESTPostAPIGuildForumThreadsJSONBody = RESTPostAPIChannelMessagesThreadsJSONBody & { + /** + * The initial message of the thread + */ + message: RESTAPIForumThreadMessageParams; + /** + * The IDs of the set of tags to apply to the thread; limited to 5 + */ + applied_tags?: Snowflake[] | undefined; +}; + +/** + * @see {@link https://docs.discord.com/developers/resources/channel#start-thread-in-forum-or-media-channel} + */ +export type RESTPostAPIGuildForumThreadsFormDataBody = RESTPostAPIChannelMessagesThreadsJSONBody & { + /** + * The initial message of the thread + */ + message: string; + /** + * The IDs of the set of tags to apply to the thread; limited to 5 + */ + applied_tags?: Snowflake[] | undefined; +}; + +/** + * @see {@link https://docs.discord.com/developers/resources/channel#start-thread-in-forum-or-media-channel} + */ +export interface RESTPostAPIGuildForumThreadsResult extends APIPublicThreadChannel { + /** + * The message that was created with the thread + */ + message: APIMessage; +} + /** * @see {@link https://discord.com/developers/docs/resources/channel#join-thread} */