Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
MR414N-ID
GitHub Repository: MR414N-ID/botku2
Path: blob/master/node_modules/@adiwajshing/baileys/lib/LegacySocket/messages.d.ts
1129 views
1
/// <reference types="node" />
2
/// <reference types="node" />
3
/// <reference types="ws" />
4
import { proto } from '../../WAProto';
5
import { AnyMessageContent, Chat, LegacySocketConfig, MiscMessageGenerationOptions, WAMessage, WAMessageCursor, WAUrlInfo } from '../Types';
6
import { MediaDownloadOptions } from '../Utils';
7
import { BinaryNode } from '../WABinary';
8
declare const makeMessagesSocket: (config: LegacySocketConfig) => {
9
relayMessage: (message: WAMessage, { waitForAck }?: {
10
waitForAck: boolean;
11
}) => Promise<void>;
12
waUploadToServer: import("../Types").WAMediaUploadFunction;
13
generateUrlInfo: (text: string) => Promise<WAUrlInfo>;
14
messageInfo: (jid: string, messageID: string) => Promise<proto.IUserReceipt[]>;
15
downloadMediaMessage: (message: WAMessage, type?: 'buffer' | 'stream', options?: MediaDownloadOptions) => Promise<Buffer | import("stream").Transform>;
16
updateMediaMessage: (message: WAMessage) => Promise<proto.IWebMessageInfo>;
17
fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<proto.WebMessageInfo[]>;
18
/** Load a single message specified by the ID */
19
loadMessageFromWA: (jid: string, id: string) => Promise<proto.WebMessageInfo>;
20
searchMessages: (txt: string, inJid: string | null, count: number, page: number) => Promise<{
21
last: boolean;
22
messages: proto.WebMessageInfo[];
23
}>;
24
sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & {
25
waitForAck?: boolean;
26
}) => Promise<proto.WebMessageInfo | undefined>;
27
sendChatsQuery: (epoch: number) => Promise<string>;
28
profilePictureUrl: (jid: string, timeoutMs?: number | undefined) => Promise<string | undefined>;
29
chatRead: (fromMessage: proto.IMessageKey, count: number) => Promise<void>;
30
chatModify: (modification: import("../Types").ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number | undefined) => Promise<void | {
31
status: number;
32
}>;
33
onWhatsApp: (str: string) => Promise<{
34
exists: boolean;
35
jid: string;
36
isBusiness: boolean;
37
} | undefined>;
38
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string | undefined) => Promise<string>;
39
presenceSubscribe: (jid: string) => Promise<string>;
40
getStatus: (jid: string) => Promise<{
41
status: string;
42
}>;
43
setStatus: (status: string) => Promise<{
44
status: number;
45
}>;
46
updateBusinessProfile: (profile: import("../Types").WABusinessProfile) => Promise<void>;
47
updateProfileName: (name: string) => Promise<{
48
status: number;
49
pushname: string;
50
}>;
51
updateProfilePicture(jid: string, imgBuffer: Buffer): Promise<void>;
52
blockUser: (jid: string, type?: "add" | "remove") => Promise<void>;
53
getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile>;
54
state: import("../Types").ConnectionState;
55
authInfo: import("../Types").LegacyAuthenticationCreds;
56
ev: import("../Types").LegacyBaileysEventEmitter;
57
canLogin: () => boolean;
58
logout: () => Promise<void>;
59
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;
60
type: "legacy";
61
ws: import("ws");
62
sendAdminTest: () => Promise<string>;
63
updateKeys: (info: {
64
encKey: Buffer;
65
macKey: Buffer;
66
}) => {
67
encKey: Buffer;
68
macKey: Buffer;
69
};
70
waitForSocketOpen: () => Promise<void>;
71
sendNode: ({ json, binaryTag, tag, longTag }: import("../Types").SocketSendMessageOptions) => Promise<string>;
72
generateMessageTag: (longTag?: boolean) => string;
73
waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number | undefined) => {
74
promise: Promise<any>;
75
cancelToken: () => void;
76
};
77
query: ({ json, timeoutMs, expect200, tag, longTag, binaryTag, requiresPhoneConnection }: import("../Types").SocketQueryOptions) => Promise<any>;
78
setQuery: (nodes: BinaryNode[], binaryTag?: import("../Types").WATag, tag?: string | undefined) => Promise<{
79
status: number;
80
}>;
81
currentEpoch: () => number;
82
end: (error: Error | undefined) => void;
83
};
84
export default makeMessagesSocket;
85
86