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/groups.d.ts
1129 views
1
/// <reference types="node" />
2
/// <reference types="node" />
3
/// <reference types="ws" />
4
import { GroupMetadata, LegacySocketConfig, ParticipantAction } from '../Types';
5
import { BinaryNode } from '../WABinary';
6
declare const makeGroupsSocket: (config: LegacySocketConfig) => {
7
groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>;
8
/**
9
* Create a group
10
* @param title like, the title of the group
11
* @param participants people to include in the group
12
*/
13
groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>;
14
/**
15
* Leave a group
16
* @param jid the ID of the group
17
*/
18
groupLeave: (id: string) => Promise<void>;
19
/**
20
* Update the subject of the group
21
* @param {string} jid the ID of the group
22
* @param {string} title the new title of the group
23
*/
24
groupUpdateSubject: (id: string, title: string) => Promise<void>;
25
/**
26
* Update the group description
27
* @param {string} jid the ID of the group
28
* @param {string} title the new title of the group
29
*/
30
groupUpdateDescription: (jid: string, description: string) => Promise<{
31
status: number;
32
}>;
33
/**
34
* Update participants in the group
35
* @param jid the ID of the group
36
* @param participants the people to add
37
*/
38
groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<{
39
jid: string;
40
status: any;
41
}[]>;
42
/** Query broadcast list info */
43
getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>;
44
groupInviteCode: (jid: string) => Promise<string>;
45
relayMessage: (message: import("../Types").WAProto.IWebMessageInfo, { waitForAck }?: {
46
waitForAck: boolean;
47
}) => Promise<void>;
48
waUploadToServer: import("../Types").WAMediaUploadFunction;
49
generateUrlInfo: (text: string) => Promise<import("../Types").WAUrlInfo>;
50
messageInfo: (jid: string, messageID: string) => Promise<import("../Types").WAProto.IUserReceipt[]>;
51
downloadMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo, type?: "stream" | "buffer", options?: import("..").MediaDownloadOptions) => Promise<Buffer | import("stream").Transform>;
52
updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise<import("../Types").WAProto.IWebMessageInfo>;
53
fetchMessagesFromWA: (jid: string, count: number, cursor?: import("../Types").WAMessageCursor | undefined) => Promise<import("../Types").WAProto.WebMessageInfo[]>;
54
loadMessageFromWA: (jid: string, id: string) => Promise<import("../Types").WAProto.WebMessageInfo>;
55
searchMessages: (txt: string, inJid: string | null, count: number, page: number) => Promise<{
56
last: boolean;
57
messages: import("../Types").WAProto.WebMessageInfo[];
58
}>;
59
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: {
60
messageId?: string | undefined;
61
cachedGroupMetadata?: ((jid: string) => Promise<import("../Types").GroupMetadataParticipants | undefined>) | undefined;
62
} & {
63
timestamp?: Date | undefined;
64
quoted?: import("../Types").WAProto.IWebMessageInfo | undefined;
65
ephemeralExpiration?: string | number | undefined;
66
mediaUploadTimeoutMs?: number | undefined;
67
} & {
68
waitForAck?: boolean | undefined;
69
}) => Promise<import("../Types").WAProto.WebMessageInfo | undefined>;
70
sendChatsQuery: (epoch: number) => Promise<string>;
71
profilePictureUrl: (jid: string, timeoutMs?: number | undefined) => Promise<string | undefined>;
72
chatRead: (fromMessage: import("../Types").WAProto.IMessageKey, count: number) => Promise<void>;
73
chatModify: (modification: import("../Types").ChatModification, jid: string, chatInfo: Pick<import("../Types").Chat, "mute" | "pin">, timestampNow?: number | undefined) => Promise<void | {
74
status: number;
75
}>;
76
onWhatsApp: (str: string) => Promise<{
77
exists: boolean;
78
jid: string;
79
isBusiness: boolean;
80
} | undefined>;
81
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string | undefined) => Promise<string>;
82
presenceSubscribe: (jid: string) => Promise<string>;
83
getStatus: (jid: string) => Promise<{
84
status: string;
85
}>;
86
setStatus: (status: string) => Promise<{
87
status: number;
88
}>;
89
updateBusinessProfile: (profile: import("../Types").WABusinessProfile) => Promise<void>;
90
updateProfileName: (name: string) => Promise<{
91
status: number;
92
pushname: string;
93
}>;
94
updateProfilePicture(jid: string, imgBuffer: Buffer): Promise<void>;
95
blockUser: (jid: string, type?: "add" | "remove") => Promise<void>;
96
getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile>;
97
state: import("../Types").ConnectionState;
98
authInfo: import("../Types").LegacyAuthenticationCreds;
99
ev: import("../Types").LegacyBaileysEventEmitter;
100
canLogin: () => boolean;
101
logout: () => Promise<void>;
102
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;
103
type: "legacy";
104
ws: import("ws");
105
sendAdminTest: () => Promise<string>;
106
updateKeys: (info: {
107
encKey: Buffer;
108
macKey: Buffer;
109
}) => {
110
encKey: Buffer;
111
macKey: Buffer;
112
};
113
waitForSocketOpen: () => Promise<void>;
114
sendNode: ({ json, binaryTag, tag, longTag }: import("../Types").SocketSendMessageOptions) => Promise<string>;
115
generateMessageTag: (longTag?: boolean) => string;
116
waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number | undefined) => {
117
promise: Promise<any>;
118
cancelToken: () => void;
119
};
120
query: ({ json, timeoutMs, expect200, tag, longTag, binaryTag, requiresPhoneConnection }: import("../Types").SocketQueryOptions) => Promise<any>;
121
setQuery: (nodes: BinaryNode[], binaryTag?: import("../Types").WATag, tag?: string | undefined) => Promise<{
122
status: number;
123
}>;
124
currentEpoch: () => number;
125
end: (error: Error | undefined) => void;
126
};
127
export default makeGroupsSocket;
128
129