mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
separate data structure for presence
This commit is contained in:
@@ -8,9 +8,8 @@ export enum Presence {
|
||||
}
|
||||
|
||||
export interface PresenceData {
|
||||
lastKnownPresence?: Presence
|
||||
lastKnownPresence: Presence
|
||||
lastSeen?: number
|
||||
name?: string
|
||||
}
|
||||
|
||||
export interface Chat {
|
||||
@@ -31,9 +30,6 @@ export interface Chat {
|
||||
eph_setting_ts?: string
|
||||
/** how long each message lasts for */
|
||||
ephemeral?: string
|
||||
|
||||
// Baileys added properties
|
||||
presences?: { [k: string]: PresenceData }
|
||||
}
|
||||
|
||||
export type ChatModification =
|
||||
|
||||
@@ -11,7 +11,7 @@ import type { Logger } from "pino"
|
||||
import type { URL } from "url"
|
||||
import type BinaryNode from "../BinaryNode"
|
||||
import { AnyAuthenticationCredentials, AuthenticationCredentials } from './Auth'
|
||||
import { Chat } from './Chat'
|
||||
import { Chat, PresenceData } from './Chat'
|
||||
import { Contact } from './Contact'
|
||||
import { ConnectionState } from './Store'
|
||||
|
||||
@@ -176,6 +176,8 @@ export type BaileysEventMap = {
|
||||
'chats.update': Partial<Chat>[]
|
||||
'chats.delete': string[]
|
||||
|
||||
'presence.update': { jid: string, presences: { [participant: string]: PresenceData } }
|
||||
|
||||
'contacts.set': { contacts: Contact[] }
|
||||
'contacts.upsert': Contact[]
|
||||
'contacts.update': Partial<Contact>[]
|
||||
|
||||
Reference in New Issue
Block a user