Skip to content

Commit dc43f22

Browse files
authored
docs: document DM history limitations in Social SDK (#8004)
Add documentation for Direct Message history retrieval limits, matching the pattern used for lobby history documentation: - Maximum of 200 messages and 72 hours of history - Both players must have played the game - Potential 404 HTTPError if either user hasn't played the game
1 parent 68da444 commit dc43f22

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

docs/discord-social-sdk/development-guides/sending-direct-messages.mdx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ Use [`Client::GetUserMessagesWithLimit`] to fetch message history from a specifi
154154

155155
```cpp
156156
const uint64_t recipientId = 1234567890; // The other user's Discord ID
157-
const int32_t messageLimit = 50; // Number of recent messages to retrieve
157+
const int32_t messageLimit = 50; // Number of recent messages to retrieve (max 200)
158158

159159
client->GetUserMessagesWithLimit(
160160
recipientId, messageLimit,
@@ -176,11 +176,16 @@ client->GetUserMessagesWithLimit(
176176
);
177177
```
178178

179+
**Important limitations:**
180+
- Only a maximum of 200 messages and up to 72 hours of history can be retrieved
181+
- Both players must have played the game for DM history to be accessible
182+
- If either user hasn't played the game, the system cannot find a channel between them and may return a 404 `discordpp::ErrorType::HTTPError` error
183+
179184
Key points about [`Client::GetUserMessagesWithLimit`] that are important to note:
180185

181186
- Messages are returned in reverse chronological order (newest first)
182187
- The function checks the local cache first and only makes an HTTP request if needed
183-
- Pass 0 or a negative value for `limit` to retrieve all available messages
188+
- Pass 0 or a negative value for `limit` to retrieve all available messages (up to the 200 message maximum)
184189

185190
This functionality is useful for:
186191
- Displaying conversation history when a user opens a DM

0 commit comments

Comments
 (0)