mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
feat: add event that handles join approval requests (#802)
* initial commit * lint * add type in method * add more actions / fixes participant jid / rename event * fixes * more fixes * fix typing * change 'reject' to 'rejected' * chore:linting --------- Co-authored-by: Rajeh Taher <rajeh@reforward.dev>
This commit is contained in:
@@ -4,7 +4,7 @@ import { AuthenticationCreds } from './Auth'
|
||||
import { WACallEvent } from './Call'
|
||||
import { Chat, ChatUpdate, PresenceData } from './Chat'
|
||||
import { Contact } from './Contact'
|
||||
import { GroupMetadata, ParticipantAction } from './GroupMetadata'
|
||||
import { GroupMetadata, ParticipantAction, RequestJoinAction, RequestJoinMethod } from './GroupMetadata'
|
||||
import { Label } from './Label'
|
||||
import { LabelAssociation } from './LabelAssociation'
|
||||
import { MessageUpsertType, MessageUserReceiptUpdate, WAMessage, WAMessageKey, WAMessageUpdate } from './Message'
|
||||
@@ -52,6 +52,7 @@ export type BaileysEventMap = {
|
||||
'groups.update': Partial<GroupMetadata>[]
|
||||
/** apply an action to participants in a group */
|
||||
'group-participants.update': { id: string, author: string, participants: string[], action: ParticipantAction }
|
||||
'group.join-request': { id: string, author: string, participant: string, action: RequestJoinAction, method: RequestJoinMethod }
|
||||
|
||||
'blocklist.set': { blocklist: string[] }
|
||||
'blocklist.update': { blocklist: string[], type: 'add' | 'remove' }
|
||||
|
||||
@@ -4,6 +4,10 @@ export type GroupParticipant = (Contact & { isAdmin?: boolean, isSuperAdmin?: bo
|
||||
|
||||
export type ParticipantAction = 'add' | 'remove' | 'promote' | 'demote'
|
||||
|
||||
export type RequestJoinAction = 'created' | 'revoked' | 'rejected'
|
||||
|
||||
export type RequestJoinMethod = 'invite_link' | 'linked_group_join' | 'non_admin_add' | undefined
|
||||
|
||||
export interface GroupMetadata {
|
||||
id: string
|
||||
owner: string | undefined
|
||||
|
||||
Reference in New Issue
Block a user