feat(Threads): add default auto archive and minor tweaks (#142)

This commit is contained in:
ckohen
2021-06-15 05:36:39 -07:00
committed by GitHub
parent 8627c9d219
commit d2b6276119
6 changed files with 34 additions and 8 deletions

View File

@@ -132,6 +132,10 @@ export interface APIChannel extends APIPartialChannel {
* The client users member for the thread, only included in select endpoints
*/
member?: APIThreadMember;
/**
* Default duration for newly created threads, in minutes, to automatically archive the thread after recent activity
*/
default_auto_archive_duration?: ThreadAutoArchiveDuration;
}
/**
@@ -616,10 +620,6 @@ export interface APIThreadMetadata {
* Whether the thread is archived
*/
archived: boolean;
/**
* ID of the user that last archived or unarchived the thread
*/
archiver_id?: Snowflake;
/**
* Duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080
*/

View File

@@ -59,6 +59,8 @@ export enum RESTJSONErrorCodes {
GuildAlreadyHasTemplate = 30031,
MaximumThreadParticipants = 30033,
Unauthorized = 40001,
VerifyYourAccount,
@@ -114,4 +116,9 @@ export enum RESTJSONErrorCodes {
ReactionWasBlocked = 90001,
APIResourceOverloaded = 130000,
ThreadAlreadyCreatedForMessage = 160004,
ThreadLocked,
MaximumActiveThreads,
MaximumActiveAnnoucementThreads,
}

View File

@@ -122,6 +122,12 @@ export interface RESTPatchAPIChannelJSONBody {
* Channel types: newsThread, publicThread, privateThread
*/
locked?: boolean;
/**
* Default duration for newly created threads, in minutes, to automatically archive the thread after recent activity
*
* Channel types: text, news
*/
default_auto_archive_duration?: ThreadAutoArchiveDuration;
}
/**

View File

@@ -132,6 +132,10 @@ export interface APIChannel extends APIPartialChannel {
* The client users member for the thread, only included in select endpoints
*/
member?: APIThreadMember;
/**
* Default duration for newly created threads, in minutes, to automatically archive the thread after recent activity
*/
default_auto_archive_duration?: ThreadAutoArchiveDuration;
}
/**
@@ -616,10 +620,6 @@ export interface APIThreadMetadata {
* Whether the thread is archived
*/
archived: boolean;
/**
* ID of the user that last archived or unarchived the thread
*/
archiver_id?: Snowflake;
/**
* Duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080
*/

View File

@@ -59,6 +59,8 @@ export const enum RESTJSONErrorCodes {
GuildAlreadyHasTemplate = 30031,
MaximumThreadParticipants = 30033,
Unauthorized = 40001,
VerifyYourAccount,
@@ -114,4 +116,9 @@ export const enum RESTJSONErrorCodes {
ReactionWasBlocked = 90001,
APIResourceOverloaded = 130000,
ThreadAlreadyCreatedForMessage = 160004,
ThreadLocked,
MaximumActiveThreads,
MaximumActiveAnnoucementThreads,
}

View File

@@ -122,6 +122,12 @@ export interface RESTPatchAPIChannelJSONBody {
* Channel types: newsThread, publicThread, privateThread
*/
locked?: boolean;
/**
* Default duration for newly created threads, in minutes, to automatically archive the thread after recent activity
*
* Channel types: text, news
*/
default_auto_archive_duration?: ThreadAutoArchiveDuration;
}
/**