Skip to content

Commit 2b53b20

Browse files
author
Vitor
authored
feat(APIThreadChannel): add fields about new message counter capability (#532)
1 parent 907d88a commit 2b53b20

File tree

4 files changed

+60
-4
lines changed

4 files changed

+60
-4
lines changed

deno/payloads/v10/channel.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,9 @@ export interface APIThreadChannel
197197
*/
198198
thread_metadata?: APIThreadMetadata;
199199
/**
200-
* The approximate message count of the thread, does not count above 50 even if there are more messages
200+
* Number of messages (not including the initial message or deleted messages) in a thread
201+
*
202+
* If the thread was created before July 1, 2022, it stops counting at 50 messages
201203
*/
202204
message_count?: number;
203205
/**
@@ -222,6 +224,12 @@ export interface APIThreadChannel
222224
* The id of the last message sent in this thread (may not point to an existing or valid message)
223225
*/
224226
last_message_id?: Snowflake | null;
227+
/**
228+
* Number of messages ever sent in a thread
229+
*
230+
* Similar to `message_count` on message creation, but won't decrement when a message is deleted
231+
*/
232+
total_message_sent?: number;
225233
}
226234

227235
export type APIGuildForumChannel = APIGuildTextChannel<ChannelType.GuildForum>;
@@ -490,6 +498,12 @@ export interface APIMessage {
490498
* @deprecated Use `sticker_items` instead
491499
*/
492500
stickers?: APISticker[];
501+
/**
502+
* A generally increasing integer (there may be gaps or duplicates) that represents the approximate position of the message in a thread
503+
*
504+
* It can be used to estimate the relative position of the message in a thread in company with `total_message_sent` on parent thread
505+
*/
506+
position?: number;
493507
}
494508

495509
/**

deno/payloads/v9/channel.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,9 @@ export interface APIThreadChannel
197197
*/
198198
thread_metadata?: APIThreadMetadata;
199199
/**
200-
* The approximate message count of the thread, does not count above 50 even if there are more messages
200+
* Number of messages (not including the initial message or deleted messages) in a thread
201+
*
202+
* If the thread was created before July 1, 2022, it stops counting at 50 messages
201203
*/
202204
message_count?: number;
203205
/**
@@ -222,6 +224,12 @@ export interface APIThreadChannel
222224
* The id of the last message sent in this thread (may not point to an existing or valid message)
223225
*/
224226
last_message_id?: Snowflake | null;
227+
/**
228+
* Number of messages ever sent in a thread
229+
*
230+
* Similar to `message_count` on message creation, but won't decrement when a message is deleted
231+
*/
232+
total_message_sent?: number;
225233
}
226234

227235
export type APIGuildForumChannel = APIGuildTextChannel<ChannelType.GuildForum>;
@@ -490,6 +498,12 @@ export interface APIMessage {
490498
* @deprecated Use `sticker_items` instead
491499
*/
492500
stickers?: APISticker[];
501+
/**
502+
* A generally increasing integer (there may be gaps or duplicates) that represents the approximate position of the message in a thread
503+
*
504+
* It can be used to estimate the relative position of the message in a thread in company with `total_message_sent` on parent thread
505+
*/
506+
position?: number;
493507
}
494508

495509
/**

payloads/v10/channel.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,9 @@ export interface APIThreadChannel
197197
*/
198198
thread_metadata?: APIThreadMetadata;
199199
/**
200-
* The approximate message count of the thread, does not count above 50 even if there are more messages
200+
* Number of messages (not including the initial message or deleted messages) in a thread
201+
*
202+
* If the thread was created before July 1, 2022, it stops counting at 50 messages
201203
*/
202204
message_count?: number;
203205
/**
@@ -222,6 +224,12 @@ export interface APIThreadChannel
222224
* The id of the last message sent in this thread (may not point to an existing or valid message)
223225
*/
224226
last_message_id?: Snowflake | null;
227+
/**
228+
* Number of messages ever sent in a thread
229+
*
230+
* Similar to `message_count` on message creation, but won't decrement when a message is deleted
231+
*/
232+
total_message_sent?: number;
225233
}
226234

227235
export type APIGuildForumChannel = APIGuildTextChannel<ChannelType.GuildForum>;
@@ -490,6 +498,12 @@ export interface APIMessage {
490498
* @deprecated Use `sticker_items` instead
491499
*/
492500
stickers?: APISticker[];
501+
/**
502+
* A generally increasing integer (there may be gaps or duplicates) that represents the approximate position of the message in a thread
503+
*
504+
* It can be used to estimate the relative position of the message in a thread in company with `total_message_sent` on parent thread
505+
*/
506+
position?: number;
493507
}
494508

495509
/**

payloads/v9/channel.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,9 @@ export interface APIThreadChannel
197197
*/
198198
thread_metadata?: APIThreadMetadata;
199199
/**
200-
* The approximate message count of the thread, does not count above 50 even if there are more messages
200+
* Number of messages (not including the initial message or deleted messages) in a thread
201+
*
202+
* If the thread was created before July 1, 2022, it stops counting at 50 messages
201203
*/
202204
message_count?: number;
203205
/**
@@ -222,6 +224,12 @@ export interface APIThreadChannel
222224
* The id of the last message sent in this thread (may not point to an existing or valid message)
223225
*/
224226
last_message_id?: Snowflake | null;
227+
/**
228+
* Number of messages ever sent in a thread
229+
*
230+
* Similar to `message_count` on message creation, but won't decrement when a message is deleted
231+
*/
232+
total_message_sent?: number;
225233
}
226234

227235
export type APIGuildForumChannel = APIGuildTextChannel<ChannelType.GuildForum>;
@@ -490,6 +498,12 @@ export interface APIMessage {
490498
* @deprecated Use `sticker_items` instead
491499
*/
492500
stickers?: APISticker[];
501+
/**
502+
* A generally increasing integer (there may be gaps or duplicates) that represents the approximate position of the message in a thread
503+
*
504+
* It can be used to estimate the relative position of the message in a thread in company with `total_message_sent` on parent thread
505+
*/
506+
position?: number;
493507
}
494508

495509
/**

0 commit comments

Comments
 (0)