-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Expand file tree
/
Copy pathGroupMetadata.ts
More file actions
74 lines (67 loc) · 2.15 KB
/
GroupMetadata.ts
File metadata and controls
74 lines (67 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import type { Contact } from './Contact'
import type { WAMessageAddressingMode } from './Message'
export type GroupParticipant = Contact & {
isAdmin?: boolean
isSuperAdmin?: boolean
admin?: 'admin' | 'superadmin' | null
}
export type ParticipantAction = 'add' | 'remove' | 'promote' | 'demote' | 'modify'
export type RequestJoinAction = 'created' | 'revoked' | 'rejected'
export type RequestJoinMethod = 'invite_link' | 'linked_group_join' | 'non_admin_add' | undefined
export interface GroupMetadata {
id: string
notify?: string
/** group uses 'lid' or 'pn' to send messages */
addressingMode?: WAMessageAddressingMode
owner: string | undefined
ownerPn?: string | undefined
ownerUsername?: string | undefined
owner_country_code?: string | undefined
subject: string
/** group subject owner */
subjectOwner?: string
subjectOwnerPn?: string
subjectOwnerUsername?: string
/** group subject modification date */
subjectTime?: number
creation?: number
desc?: string
descOwner?: string
descOwnerPn?: string
descOwnerUsername?: string
descId?: string
descTime?: number
/** if this group is part of a community, it returns the jid of the community to which it belongs */
linkedParent?: 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
/** is set when the group also allows members to add participants */
memberAddMode?: boolean
/** Request approval to join the group */
joinApprovalMode?: boolean
/** is this a community */
isCommunity?: boolean
/** is this the announce of a community */
isCommunityAnnounce?: boolean
/** number of group participants */
size?: number
// Baileys modified array
participants: GroupParticipant[]
ephemeralDuration?: number
inviteCode?: string
/** the person who added you to group or changed some setting in group */
author?: string
authorPn?: string
authorUsername?: string
}
export interface WAGroupCreateResponse {
status: number
gid?: string
participants?: [{ [key: string]: {} }]
}
export interface GroupModificationResponse {
status: number
participants?: { [key: string]: {} }
}