-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdm.ts
More file actions
99 lines (93 loc) · 2.74 KB
/
Copy pathdm.ts
File metadata and controls
99 lines (93 loc) · 2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import { dmConversations } from "../funcs/dm-conversations.js";
import { dmHistory } from "../funcs/dm-history.js";
import { dmMedia } from "../funcs/dm-media.js";
import { dmSend } from "../funcs/dm-send.js";
import { dmStatus } from "../funcs/dm-status.js";
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
import * as models from "../models/index.js";
import { unwrapAsync } from "../types/fp.js";
export class Dm extends ClientSDK {
/**
* Check DM Permissions
*
* @remarks
* Retrieves the Direct Message (DM) availability status for a list of users. This endpoint checks if the specified accounts can receive messages based on their privacy settings, follow status, or verified permissions.
*/
async status(
request: Array<string>,
options?: RequestOptions,
): Promise<models.DMStatusResponseV2> {
return unwrapAsync(dmStatus(
this,
request,
options,
));
}
/**
* Send DM
*
* @remarks
* Send DM via XChat encrypted chat API (1:1 or existing group g...), optional image via media_urls (max 1) or video via video_url (mutually exclusive). $0.001 per call.
*/
async send(
request: models.SendDmV3Query,
options?: RequestOptions,
): Promise<models.SendDmResponse> {
return unwrapAsync(dmSend(
this,
request,
options,
));
}
/**
* Get DM History
*
* @remarks
* Get DM history via XChat encrypted chat API. Use count for page size (10–200). Set all=true to follow has_more and return every page. Or paginate manually: when has_more is true, pass the oldest message's sequence_id as before.
*/
async history(
request: models.GetDmHistoryV3Query,
options?: RequestOptions,
): Promise<models.GetDmHistoryV3Response> {
return unwrapAsync(dmHistory(
this,
request,
options,
));
}
/**
* Get DM Media
*
* @remarks
* Fetch one XChat media attachment and return a playable URL. Use conversation_id, media_hash_key, and optional key_version from /v3/twitter/dm-history attachments.
*/
async media(
request: models.GetDmMediaV3Query,
options?: RequestOptions,
): Promise<models.GetDmMediaV3Response> {
return unwrapAsync(dmMedia(
this,
request,
options,
));
}
/**
* Get Conversations
*
* @remarks
* Get XChat conversation list. Use count for page size (10–200). Set all=true to follow the inbox cursor and return every conversation.
*/
async conversations(
request: models.GetConversationsV3Query,
options?: RequestOptions,
): Promise<models.GetConversationsV3Response> {
return unwrapAsync(dmConversations(
this,
request,
options,
));
}
}