nodejs-insta-private-api-mqt 1.4.2 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -226,13 +226,26 @@ class DirectCommands {
|
|
|
226
226
|
},
|
|
227
227
|
});
|
|
228
228
|
}
|
|
229
|
-
async
|
|
230
|
-
|
|
229
|
+
async sendText({ text, clientContext, threadId }) {
|
|
230
|
+
const timestamp = Date.now() * 1000;
|
|
231
|
+
const messageId = `${timestamp}-${Math.random().toString(36).substr(2, 9)}`;
|
|
232
|
+
|
|
233
|
+
const result = await this.sendItem({
|
|
234
|
+
itemType: 'text',
|
|
235
|
+
threadId,
|
|
236
|
+
clientContext: messageId,
|
|
237
|
+
timestamp,
|
|
238
|
+
offline_threading_id: messageId,
|
|
239
|
+
data: {
|
|
231
240
|
text,
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
241
|
+
},
|
|
242
|
+
ttl: 0,
|
|
243
|
+
shh_mode: false,
|
|
244
|
+
send_attribution: 'direct_thread',
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
return result;
|
|
248
|
+
}
|
|
236
249
|
async markAsSeen({ threadId, itemId }) {
|
|
237
250
|
return this.sendCommand({
|
|
238
251
|
action: 'mark_seen',
|
|
@@ -272,19 +272,26 @@ class EnhancedDirectCommands {
|
|
|
272
272
|
/**
|
|
273
273
|
* Send text via MQTT
|
|
274
274
|
*/
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
275
|
+
async sendText({ text, clientContext, threadId }) {
|
|
276
|
+
const timestamp = Date.now() * 1000;
|
|
277
|
+
const messageId = `${timestamp}-${Math.random().toString(36).substr(2, 9)}`;
|
|
278
|
+
|
|
279
|
+
const result = await this.sendItem({
|
|
280
|
+
itemType: 'text',
|
|
281
|
+
threadId,
|
|
282
|
+
clientContext: messageId,
|
|
283
|
+
timestamp,
|
|
284
|
+
offline_threading_id: messageId,
|
|
285
|
+
data: {
|
|
286
|
+
text,
|
|
287
|
+
},
|
|
288
|
+
ttl: 0,
|
|
289
|
+
shh_mode: false,
|
|
290
|
+
send_attribution: 'direct_thread',
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
return result;
|
|
294
|
+
}
|
|
288
295
|
/**
|
|
289
296
|
* Alias for sendText
|
|
290
297
|
*/
|