From a28c824f82014b15a715b51b4426356428bb4ba2 Mon Sep 17 00:00:00 2001 From: Vitor Lopes Date: Fri, 29 Apr 2022 21:37:22 +0100 Subject: [PATCH] feat(RESTPostAPIGuildForumThreads): add `message` field (#416) * refactor(GuildFeature): remove seven & three day thread archive * refactor(RESTPostAPIGuildForumThreadsJSONBody): add `message` field * chore: branch issues fix * fix: unnecessary type & correct `message` type * fix: use json body instead of form data * feat: update also form data * fix: revert order & `message` type --- deno/rest/v10/channel.ts | 15 ++++++++++++--- deno/rest/v9/channel.ts | 15 ++++++++++++--- rest/v10/channel.ts | 15 ++++++++++++--- rest/v9/channel.ts | 15 ++++++++++++--- 4 files changed, 48 insertions(+), 12 deletions(-) diff --git a/deno/rest/v10/channel.ts b/deno/rest/v10/channel.ts index d77109ed..f260fa61 100644 --- a/deno/rest/v10/channel.ts +++ b/deno/rest/v10/channel.ts @@ -584,13 +584,22 @@ export type RESTPostAPIChannelMessagesThreadsJSONBody = AddUndefinedToPossiblyUn /** * https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel */ -export type RESTPostAPIGuildForumThreadsJSONBody = RESTPostAPIChannelMessagesThreadsJSONBody & - RESTPostAPIChannelMessageJSONBody; +export type RESTPostAPIGuildForumThreadsJSONBody = RESTPostAPIChannelMessagesThreadsJSONBody & { + /** + * First message in the forum thread + */ + message: RESTPostAPIChannelMessageJSONBody; +}; /** * https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel */ -export type RESTPostAPIGuildForumThreadsFormDataBody = RESTPostAPIChannelMessageFormDataBody; +export type RESTPostAPIGuildForumThreadsFormDataBody = RESTPostAPIChannelMessagesThreadsJSONBody & { + /** + * First message in the forum thread + */ + message: string; +}; /** * https://discord.com/developers/docs/resources/channel#start-thread-from-message diff --git a/deno/rest/v9/channel.ts b/deno/rest/v9/channel.ts index fa98f33a..3aab0b94 100644 --- a/deno/rest/v9/channel.ts +++ b/deno/rest/v9/channel.ts @@ -598,13 +598,22 @@ export type RESTPostAPIChannelMessagesThreadsJSONBody = AddUndefinedToPossiblyUn /** * https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel */ -export type RESTPostAPIGuildForumThreadsJSONBody = RESTPostAPIChannelMessagesThreadsJSONBody & - RESTPostAPIChannelMessageJSONBody; +export type RESTPostAPIGuildForumThreadsJSONBody = RESTPostAPIChannelMessagesThreadsJSONBody & { + /** + * First message in the forum thread + */ + message: RESTPostAPIChannelMessageJSONBody; +}; /** * https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel */ -export type RESTPostAPIGuildForumThreadsFormDataBody = RESTPostAPIChannelMessageFormDataBody; +export type RESTPostAPIGuildForumThreadsFormDataBody = RESTPostAPIChannelMessagesThreadsJSONBody & { + /** + * First message in the forum thread + */ + message: string; +}; /** * https://discord.com/developers/docs/resources/channel#start-thread-from-message diff --git a/rest/v10/channel.ts b/rest/v10/channel.ts index f333831b..08691db3 100644 --- a/rest/v10/channel.ts +++ b/rest/v10/channel.ts @@ -584,13 +584,22 @@ export type RESTPostAPIChannelMessagesThreadsJSONBody = AddUndefinedToPossiblyUn /** * https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel */ -export type RESTPostAPIGuildForumThreadsJSONBody = RESTPostAPIChannelMessagesThreadsJSONBody & - RESTPostAPIChannelMessageJSONBody; +export type RESTPostAPIGuildForumThreadsJSONBody = RESTPostAPIChannelMessagesThreadsJSONBody & { + /** + * First message in the forum thread + */ + message: RESTPostAPIChannelMessageJSONBody; +}; /** * https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel */ -export type RESTPostAPIGuildForumThreadsFormDataBody = RESTPostAPIChannelMessageFormDataBody; +export type RESTPostAPIGuildForumThreadsFormDataBody = RESTPostAPIChannelMessagesThreadsJSONBody & { + /** + * First message in the forum thread + */ + message: string; +}; /** * https://discord.com/developers/docs/resources/channel#start-thread-from-message diff --git a/rest/v9/channel.ts b/rest/v9/channel.ts index f278028c..175d6f3c 100644 --- a/rest/v9/channel.ts +++ b/rest/v9/channel.ts @@ -598,13 +598,22 @@ export type RESTPostAPIChannelMessagesThreadsJSONBody = AddUndefinedToPossiblyUn /** * https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel */ -export type RESTPostAPIGuildForumThreadsJSONBody = RESTPostAPIChannelMessagesThreadsJSONBody & - RESTPostAPIChannelMessageJSONBody; +export type RESTPostAPIGuildForumThreadsJSONBody = RESTPostAPIChannelMessagesThreadsJSONBody & { + /** + * First message in the forum thread + */ + message: RESTPostAPIChannelMessageJSONBody; +}; /** * https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel */ -export type RESTPostAPIGuildForumThreadsFormDataBody = RESTPostAPIChannelMessageFormDataBody; +export type RESTPostAPIGuildForumThreadsFormDataBody = RESTPostAPIChannelMessagesThreadsJSONBody & { + /** + * First message in the forum thread + */ + message: string; +}; /** * https://discord.com/developers/docs/resources/channel#start-thread-from-message