Skip to content

Commit

Permalink
feat(Threads): add default auto archive and minor tweaks (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
ckohen committed Jun 15, 2021
1 parent 8627c9d commit d2b6276
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 8 deletions.
8 changes: 4 additions & 4 deletions deno/payloads/v9/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down Expand Up @@ -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
*/
Expand Down
7 changes: 7 additions & 0 deletions deno/rest/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ export enum RESTJSONErrorCodes {

GuildAlreadyHasTemplate = 30031,

MaximumThreadParticipants = 30033,

Unauthorized = 40001,
VerifyYourAccount,

Expand Down Expand Up @@ -114,4 +116,9 @@ export enum RESTJSONErrorCodes {
ReactionWasBlocked = 90001,

APIResourceOverloaded = 130000,

ThreadAlreadyCreatedForMessage = 160004,
ThreadLocked,
MaximumActiveThreads,
MaximumActiveAnnoucementThreads,
}
6 changes: 6 additions & 0 deletions deno/rest/v9/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
8 changes: 4 additions & 4 deletions payloads/v9/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down Expand Up @@ -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
*/
Expand Down
7 changes: 7 additions & 0 deletions rest/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ export const enum RESTJSONErrorCodes {

GuildAlreadyHasTemplate = 30031,

MaximumThreadParticipants = 30033,

Unauthorized = 40001,
VerifyYourAccount,

Expand Down Expand Up @@ -114,4 +116,9 @@ export const enum RESTJSONErrorCodes {
ReactionWasBlocked = 90001,

APIResourceOverloaded = 130000,

ThreadAlreadyCreatedForMessage = 160004,
ThreadLocked,
MaximumActiveThreads,
MaximumActiveAnnoucementThreads,
}
6 changes: 6 additions & 0 deletions rest/v9/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit d2b6276

Please sign in to comment.