Skip to content

Commit

Permalink
feat(Threads): add typed thread creation (#148)
Browse files Browse the repository at this point in the history
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
3 people committed Jun 24, 2021
1 parent e36ef9e commit f393ba5
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
17 changes: 16 additions & 1 deletion deno/rest/v9/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ export type RESTDeleteAPIChannelRecipientResult = unknown;
/**
* https://discord.com/developers/docs/resources/channel#start-thread-with-message
*/
export interface RESTPostAPIChannelThreadsJSONBody {
export interface RESTPostAPIChannelMessagesThreadsJSONBody {
/**
* 2-100 character thread name
*/
Expand All @@ -529,6 +529,21 @@ export interface RESTPostAPIChannelThreadsJSONBody {
/**
* https://discord.com/developers/docs/resources/channel#start-thread-with-message
*/
export type RESTPostAPIChannelMessagesThreadsResult = APIChannel;

/**
* https://discord.com/developers/docs/resources/channel#start-thread-without-message
*/
export interface RESTPostAPIChannelThreadsJSONBody extends RESTPostAPIChannelMessagesThreadsJSONBody {
/**
* The type of thread to create
*/
type: ChannelType.GuildNewsThread | ChannelType.GuildPublicThread | ChannelType.GuildPrivateThread;
}

/**
* https://discord.com/developers/docs/resources/channel#start-thread-without-message
*/
export type RESTPostAPIChannelThreadsResult = APIChannel;

/**
Expand Down
17 changes: 16 additions & 1 deletion rest/v9/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ export type RESTDeleteAPIChannelRecipientResult = unknown;
/**
* https://discord.com/developers/docs/resources/channel#start-thread-with-message
*/
export interface RESTPostAPIChannelThreadsJSONBody {
export interface RESTPostAPIChannelMessagesThreadsJSONBody {
/**
* 2-100 character thread name
*/
Expand All @@ -529,6 +529,21 @@ export interface RESTPostAPIChannelThreadsJSONBody {
/**
* https://discord.com/developers/docs/resources/channel#start-thread-with-message
*/
export type RESTPostAPIChannelMessagesThreadsResult = APIChannel;

/**
* https://discord.com/developers/docs/resources/channel#start-thread-without-message
*/
export interface RESTPostAPIChannelThreadsJSONBody extends RESTPostAPIChannelMessagesThreadsJSONBody {
/**
* The type of thread to create
*/
type: ChannelType.GuildNewsThread | ChannelType.GuildPublicThread | ChannelType.GuildPrivateThread;
}

/**
* https://discord.com/developers/docs/resources/channel#start-thread-without-message
*/
export type RESTPostAPIChannelThreadsResult = APIChannel;

/**
Expand Down

0 comments on commit f393ba5

Please sign in to comment.