feat(Threads): add typed thread creation (#148)

Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
ckohen
2021-06-24 02:30:56 -07:00
committed by GitHub
parent e36ef9e1d2
commit f393ba520d
2 changed files with 32 additions and 2 deletions

View File

@@ -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
*/
@@ -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;
/**

View File

@@ -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
*/
@@ -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;
/**