mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
update proto + message info
This commit is contained in:
@@ -129,24 +129,14 @@ export type MessageGenerationOptions = MessageContentGenerationOptions & Message
|
||||
|
||||
export type MessageUpdateType = 'prepend' | 'append' | 'notify' | 'last'
|
||||
|
||||
export type MessageInfoEventMap = { [jid: string]: Date }
|
||||
export interface MessageInfo {
|
||||
reads: {jid: string, t: string}[]
|
||||
deliveries: {jid: string, t: string}[]
|
||||
}
|
||||
|
||||
|
||||
export interface MessageStatusUpdate {
|
||||
from: string
|
||||
to: string
|
||||
/** Which participant caused the update (only for groups) */
|
||||
participant?: string
|
||||
timestamp: Date
|
||||
/** Message IDs read/delivered */
|
||||
ids: string[]
|
||||
/** Status of the Message IDs */
|
||||
type: WAMessageStatus
|
||||
reads: MessageInfoEventMap
|
||||
deliveries: MessageInfoEventMap
|
||||
}
|
||||
|
||||
export type WAMessageUpdate = { update: Partial<WAMessage>, key: proto.IMessageKey }
|
||||
|
||||
export type WAMessageCursor = { before: WAMessageKey | undefined } | { after: WAMessageKey | undefined }
|
||||
export type WAMessageCursor = { before: WAMessageKey | undefined } | { after: WAMessageKey | undefined }
|
||||
|
||||
export type MessageInfoUpdate = { key: proto.IMessageKey, update: Partial<MessageInfo> }
|
||||
@@ -16,7 +16,8 @@ import { Contact } from './Contact'
|
||||
import { ConnectionState } from './Store'
|
||||
|
||||
import { GroupMetadata, ParticipantAction } from './GroupMetadata'
|
||||
import { MessageUpdateType, WAMessage, WAMessageKey, WAMessageUpdate } from './Message'
|
||||
import { MessageInfo, MessageInfoUpdate, MessageUpdateType, WAMessage, WAMessageKey, WAMessageUpdate } from './Message'
|
||||
import { proto } from '../../WAMessage/WAMessage'
|
||||
|
||||
/** used for binary messages */
|
||||
export enum WAMetric {
|
||||
@@ -183,6 +184,8 @@ export type BaileysEventMap = {
|
||||
'messages.update': WAMessageUpdate[]
|
||||
'messages.upsert': { messages: WAMessage[], type: MessageUpdateType }
|
||||
|
||||
'message-info.update': MessageInfoUpdate[]
|
||||
|
||||
'groups.update': Partial<GroupMetadata>[]
|
||||
'group-participants.update': { jid: string, participants: string[], action: ParticipantAction }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user