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