mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
refactor: use the proto UserReceipt instead of custom MessageInfo
This commit is contained in:
@@ -3,7 +3,7 @@ import { AuthenticationCreds } from './Auth'
|
||||
import { Chat, PresenceData } from './Chat'
|
||||
import { Contact } from './Contact'
|
||||
import { GroupMetadata, ParticipantAction } from './GroupMetadata'
|
||||
import { MessageInfoUpdate, MessageUpdateType, WAMessage, WAMessageKey, WAMessageUpdate } from './Message'
|
||||
import { MessageUpdateType, MessageUserReceiptUpdate, WAMessage, WAMessageKey, WAMessageUpdate } from './Message'
|
||||
import { ConnectionState } from './State'
|
||||
|
||||
export type BaileysEventMap<T> = {
|
||||
@@ -37,7 +37,7 @@ export type BaileysEventMap<T> = {
|
||||
* */
|
||||
'messages.upsert': { messages: WAMessage[], type: MessageUpdateType }
|
||||
|
||||
'message-info.update': MessageInfoUpdate[]
|
||||
'message-receipt.update': MessageUserReceiptUpdate[]
|
||||
|
||||
'groups.upsert': GroupMetadata[]
|
||||
'groups.update': Partial<GroupMetadata>[]
|
||||
|
||||
@@ -166,14 +166,10 @@ export type MessageGenerationOptions = MessageContentGenerationOptions & Message
|
||||
|
||||
export type MessageUpdateType = 'append' | 'notify' | 'replace'
|
||||
|
||||
export type MessageInfoEventMap = { [jid: string]: Date }
|
||||
export interface MessageInfo {
|
||||
reads: MessageInfoEventMap
|
||||
deliveries: MessageInfoEventMap
|
||||
}
|
||||
export type MessageUserReceipt = proto.IUserReceipt
|
||||
|
||||
export type WAMessageUpdate = { update: Partial<WAMessage>, key: proto.IMessageKey }
|
||||
|
||||
export type WAMessageCursor = { before: WAMessageKey | undefined } | { after: WAMessageKey | undefined }
|
||||
|
||||
export type MessageInfoUpdate = { key: proto.IMessageKey, update: Partial<MessageInfo> }
|
||||
export type MessageUserReceiptUpdate = { key: proto.IMessageKey, receipt: MessageUserReceipt }
|
||||
|
||||
Reference in New Issue
Block a user