mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
* feat: Returns an object with information about the invite code's group * refactor: more information in metadata group
40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
import { Contact } from './Contact'
|
|
|
|
export type GroupParticipant = (Contact & { isAdmin?: boolean; isSuperAdmin?: boolean, admin?: 'admin' | 'superadmin' | null })
|
|
|
|
export type ParticipantAction = 'add' | 'remove' | 'promote' | 'demote'
|
|
|
|
export interface GroupMetadata {
|
|
id: string
|
|
owner: string | undefined
|
|
subject: string
|
|
/** group subject owner */
|
|
subjectOwner?: string
|
|
/** group subject modification date */
|
|
subjectTime?: number
|
|
creation: number
|
|
desc?: string
|
|
descOwner?: string
|
|
descId?: string
|
|
/** is set when the group only allows admins to change group settings */
|
|
restrict?: boolean
|
|
/** is set when the group only allows admins to write messages */
|
|
announce?: boolean
|
|
/** number of group participants */
|
|
size?: number
|
|
// Baileys modified array
|
|
participants: GroupParticipant[]
|
|
ephemeralDuration?: number
|
|
}
|
|
|
|
|
|
export interface WAGroupCreateResponse {
|
|
status: number
|
|
gid?: string
|
|
participants?: [{ [key: string]: any }]
|
|
}
|
|
|
|
export interface GroupModificationResponse {
|
|
status: number
|
|
participants?: { [key: string]: any }
|
|
} |