From c1975f70f172b4a6d71a9d045abb82d3dcc4e8c3 Mon Sep 17 00:00:00 2001 From: lts20050703 <87189679+lts20050703@users.noreply.github.com> Date: Wed, 26 Jan 2022 18:02:37 +0700 Subject: [PATCH 1/5] Document thread.create_timestamp --- src/types/channels/threads/threadMetadata.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/types/channels/threads/threadMetadata.ts b/src/types/channels/threads/threadMetadata.ts index d0d56afe8..93fecbc1e 100644 --- a/src/types/channels/threads/threadMetadata.ts +++ b/src/types/channels/threads/threadMetadata.ts @@ -10,4 +10,6 @@ export interface ThreadMetadata { locked?: boolean; /** whether non-moderators can add other non-moderators to a thread; only available on private threads */ invitable?: boolean; + /** Timestamp when the thread was created; only populated for threads created after 2022-01-09 */ + createTimestamp: number; } From 38cb526100898881663917cc78c5a708b9de650f Mon Sep 17 00:00:00 2001 From: lts20050703 <87189679+lts20050703@users.noreply.github.com> Date: Wed, 26 Jan 2022 22:58:37 +0700 Subject: [PATCH 2/5] should be string --- src/types/channels/threads/threadMetadata.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types/channels/threads/threadMetadata.ts b/src/types/channels/threads/threadMetadata.ts index 93fecbc1e..209d0862d 100644 --- a/src/types/channels/threads/threadMetadata.ts +++ b/src/types/channels/threads/threadMetadata.ts @@ -11,5 +11,5 @@ export interface ThreadMetadata { /** whether non-moderators can add other non-moderators to a thread; only available on private threads */ invitable?: boolean; /** Timestamp when the thread was created; only populated for threads created after 2022-01-09 */ - createTimestamp: number; + createTimestamp: string; } From 7f65c7073380cfefc063e58dc47ed2cd26badb02 Mon Sep 17 00:00:00 2001 From: lts20050703 <87189679+lts20050703@users.noreply.github.com> Date: Thu, 27 Jan 2022 16:59:22 +0700 Subject: [PATCH 3/5] Add invitable and createTimestamp to Channel & DiscordenoChannel interface --- src/transformers/channel.ts | 4 ++++ src/types/channels/channel.ts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/transformers/channel.ts b/src/transformers/channel.ts index e91c31a1c..f43b82e33 100644 --- a/src/transformers/channel.ts +++ b/src/transformers/channel.ts @@ -73,6 +73,8 @@ export function transformChannel( botIsMember: Boolean(payload.channel.member), archived: payload.channel.thread_metadata?.archived, locked: payload.channel.thread_metadata?.locked, + invitable: payload.channel.invitable, + createTimestamp: payload.channel.create_timestamp, }; } @@ -143,4 +145,6 @@ export interface DiscordenoChannel { parentId?: bigint; /** The voice states that are in this channel assuming it is a voice channel. */ voiceStates?: Collection; + /** timestamp when the thread was created; only populated for threads created after 2022-01-09 */ + createTimestamp?: string; } diff --git a/src/types/channels/channel.ts b/src/types/channels/channel.ts index 022a86b9b..8c2dfd6e0 100644 --- a/src/types/channels/channel.ts +++ b/src/types/channels/channel.ts @@ -60,4 +60,8 @@ export interface Channel { defaultAutoArchiveDuration?: number; /** computed permissions for the invoking user in the channel, including overwrites, only included when part of the resolved data received on a application command interaction */ permissions?: string; + /** whether non-moderators can add other non-moderators to a thread; only available on private threads */ + invitable?: boolean; + /** timestamp when the thread was created; only populated for threads created after 2022-01-09 */ + createTimestamp?: string; } From d155ea82dbd9be63bb93beaca627013c6ae69e73 Mon Sep 17 00:00:00 2001 From: lts20050703 <87189679+lts20050703@users.noreply.github.com> Date: Fri, 28 Jan 2022 07:37:46 +0700 Subject: [PATCH 4/5] createTimestamp should be number --- src/transformers/channel.ts | 2 +- src/types/channels/channel.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/transformers/channel.ts b/src/transformers/channel.ts index f43b82e33..8ef1c0284 100644 --- a/src/transformers/channel.ts +++ b/src/transformers/channel.ts @@ -146,5 +146,5 @@ export interface DiscordenoChannel { /** The voice states that are in this channel assuming it is a voice channel. */ voiceStates?: Collection; /** timestamp when the thread was created; only populated for threads created after 2022-01-09 */ - createTimestamp?: string; + createTimestamp?: number; } diff --git a/src/types/channels/channel.ts b/src/types/channels/channel.ts index 8c2dfd6e0..08eceba10 100644 --- a/src/types/channels/channel.ts +++ b/src/types/channels/channel.ts @@ -63,5 +63,5 @@ export interface Channel { /** whether non-moderators can add other non-moderators to a thread; only available on private threads */ invitable?: boolean; /** timestamp when the thread was created; only populated for threads created after 2022-01-09 */ - createTimestamp?: string; + createTimestamp?: number; } From 047e8b69d496dc2171d92398dc5cf105ffd0fe3b Mon Sep 17 00:00:00 2001 From: lts20050703 <87189679+lts20050703@users.noreply.github.com> Date: Fri, 28 Jan 2022 07:41:23 +0700 Subject: [PATCH 5/5] createTimestamp: discord return string, discordeno return number --- src/transformers/channel.ts | 2 +- src/types/channels/channel.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/transformers/channel.ts b/src/transformers/channel.ts index 8ef1c0284..d0142a2dd 100644 --- a/src/transformers/channel.ts +++ b/src/transformers/channel.ts @@ -74,7 +74,7 @@ export function transformChannel( archived: payload.channel.thread_metadata?.archived, locked: payload.channel.thread_metadata?.locked, invitable: payload.channel.invitable, - createTimestamp: payload.channel.create_timestamp, + createTimestamp: payload.channel.create_timestamp ? Date.parse(payload.channel.create_timestamp) : undefined, }; } diff --git a/src/types/channels/channel.ts b/src/types/channels/channel.ts index 08eceba10..8c2dfd6e0 100644 --- a/src/types/channels/channel.ts +++ b/src/types/channels/channel.ts @@ -63,5 +63,5 @@ export interface Channel { /** whether non-moderators can add other non-moderators to a thread; only available on private threads */ invitable?: boolean; /** timestamp when the thread was created; only populated for threads created after 2022-01-09 */ - createTimestamp?: number; + createTimestamp?: string; }