Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
MR414N-ID
GitHub Repository: MR414N-ID/botku2
Path: blob/master/node_modules/@adiwajshing/baileys/lib/Socket/groups.d.ts
1129 views
1
/// <reference types="ws" />
2
/// <reference types="node" />
3
import { proto } from '../../WAProto';
4
import { GroupMetadata, ParticipantAction, SocketConfig } from '../Types';
5
import { BinaryNode } from '../WABinary';
6
export declare const makeGroupsSocket: (config: SocketConfig) => {
7
groupMetadata: (jid: string) => Promise<GroupMetadata>;
8
groupCreate: (subject: string, participants: string[]) => Promise<GroupMetadata>;
9
groupLeave: (id: string) => Promise<void>;
10
groupUpdateSubject: (jid: string, subject: string) => Promise<void>;
11
groupParticipantsUpdate: (jid: string, participants: string[], action: ParticipantAction) => Promise<{
12
status: string;
13
jid: string;
14
}[]>;
15
groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
16
groupInviteCode: (jid: string) => Promise<string | undefined>;
17
groupRevokeInvite: (jid: string) => Promise<string | undefined>;
18
groupAcceptInvite: (code: string) => Promise<string | undefined>;
19
/**
20
* accept a GroupInviteMessage
21
* @param key the key of the invite message, or optionally only provide the jid of the person who sent the invite
22
* @param inviteMessage the message to accept
23
*/
24
groupAcceptInviteV4: (key: string | proto.IMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<string>;
25
groupGetInviteInfo: (code: string) => Promise<GroupMetadata>;
26
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
27
groupSettingUpdate: (jid: string, setting: 'announcement' | 'not_announcement' | 'locked' | 'unlocked') => Promise<void>;
28
groupFetchAllParticipating: () => Promise<{
29
[_: string]: GroupMetadata;
30
}>;
31
processingMutex: {
32
mutex<T>(code: () => T | Promise<T>): Promise<T>;
33
};
34
fetchPrivacySettings: (force?: boolean) => Promise<{
35
[_: string]: string;
36
}>;
37
upsertMessage: (msg: proto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
38
appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
39
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string | undefined) => Promise<void>;
40
presenceSubscribe: (toJid: string) => Promise<void>;
41
profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number | undefined) => Promise<string | undefined>;
42
onWhatsApp: (...jids: string[]) => Promise<{
43
exists: boolean;
44
jid: string;
45
}[]>;
46
fetchBlocklist: () => Promise<string[]>;
47
fetchStatus: (jid: string) => Promise<{
48
status: string | undefined;
49
setAt: Date;
50
} | undefined>;
51
updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
52
updateProfileStatus: (status: string) => Promise<void>;
53
updateProfileName: (name: string) => Promise<void>;
54
updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
55
getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>;
56
resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], recvChats: import("../Types").InitialReceivedChatsState | undefined) => Promise<void>;
57
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
58
resyncMainAppState: (ctx?: import("../Types").InitialReceivedChatsState | undefined) => Promise<void>;
59
type: "md";
60
ws: import("ws");
61
ev: import("../Types").BaileysEventEmitter & {
62
process(handler: (events: Partial<import("../Types").BaileysEventMap<import("../Types").AuthenticationCreds>>) => void | Promise<void>): () => void;
63
buffer(): boolean;
64
createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>;
65
flush(): Promise<void>;
66
processInBuffer(task: Promise<any>): any;
67
};
68
authState: {
69
creds: import("../Types").AuthenticationCreds;
70
keys: import("../Types").SignalKeyStoreWithTransaction;
71
};
72
user: import("../Types").Contact | undefined;
73
generateMessageTag: () => string;
74
query: (node: BinaryNode, timeoutMs?: number | undefined) => Promise<BinaryNode>;
75
waitForMessage: (msgId: string, timeoutMs?: number | undefined) => Promise<any>;
76
waitForSocketOpen: () => Promise<void>;
77
sendRawMessage: (data: Buffer | Uint8Array) => Promise<void>;
78
sendNode: (frame: BinaryNode) => Promise<void>;
79
logout: () => Promise<void>;
80
end: (error: Error | undefined) => void;
81
onUnexpectedError: (error: Error, msg: string) => void;
82
uploadPreKeys: (count?: number) => Promise<void>;
83
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;
84
};
85
export declare const extractGroupMetadata: (result: BinaryNode) => GroupMetadata;
86
87