Load messages by timestamp or message ID
You can retrieve a set number of previous or next messages on referenced to a specific timestamp in a channel. You can also retrieve messages by using a message ID.
By timestamp
Use the GetMessagesByTimestamp()
method to retrieve a set number of previous and next messages on both sides of a specific timestamp.
List of arguments
Argument | Type | Description |
---|---|---|
| int64_t | Specifies the timestamp to be the reference point of a retrieval, in Unix milliseconds. |
| int64_t | Specifies the number of previously sent messages to retrieve before the specified message timestamp. Note that the actual number of results may be larger than the set value when there are multiple messages with the same timestamp as the earliest message. |
| int64_t | Specifies the number of sent messages to retrieve after the specified message timestamp. Note that the actual number of results may be larger than the set value when there are multiple messages with the same timestamp as the latest message. |
| bool | Determines whether to sort the retrieved messages in reverse chronological order. If set to true, messages appear in reverse chronological order where the newest comes first and the oldest last. (Default: false) |
| enum | Specifies a message type to retrieve. Acceptable values are SBDMessageTypeFilter.All, SBDMessageTypeFilter.User, SBDMessageTypeFilter.File, and SBDMessageTypeFilter.Admin. If not specified, the scope of retrieval is set to all messages. |
| std::wstring | Specifies the custom type of messages to retrieve. If not specified, all messages are retrieved. |
By message ID
You can also retrieve a set number of previous and next messages on both sides of a specific message ID in a channel, using the GetMessagesByMessageId()
method.
List of arguments
Argument | Type | Description |
---|---|---|
| int64_t | Specifies the unique ID of the message to be the reference point of a retrieval. |
| int64_t | Specifies the number of previously sent messages to retrieve before the specified message timestamp. Note that the actual number of results may be larger than the set value when there are multiple messages with the same timestamp as the earliest message. |
| int64_t | Specifies the number of sent messages to retrieve after the specified message timestamp. Note that the actual number of results may be larger than the set value when there are multiple messages with the same timestamp as the latest message. |
| bool | Determines whether to sort the retrieved messages in reverse chronological order. If set to true, messages appear in reverse chronological order where the newest comes first and the oldest last. (Default: false) |
| enum | Specifies a message type to retrieve. Acceptable values are SBDMessageTypeFilter.All, SBDMessageTypeFilter.User, SBDMessageTypeFilter.File, and SBDMessageTypeFilter.Admin. If not specified, the scope of retrieval is set to all messages. |
| std::wstring | Specifies the custom type of messages to retrieve. If not specified, all messages are retrieved. |