mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
feat: add label feature (#955)
Co-authored-by: 刘建辉 <liujianhui@gongchang.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import type { proto } from '../../WAProto'
|
||||
import type { AccountSettings } from './Auth'
|
||||
import type { BufferedEventData } from './Events'
|
||||
import type { LabelActionBody } from './Label'
|
||||
import type { ChatLabelAssociationActionBody } from './LabelAssociation'
|
||||
import type { MessageLabelAssociationActionBody } from './LabelAssociation'
|
||||
import type { MinimalMessage } from './Message'
|
||||
@@ -90,6 +91,8 @@ export type ChatModification =
|
||||
lastMessages: LastMessageList
|
||||
}
|
||||
| { delete: true, lastMessages: LastMessageList }
|
||||
// Label
|
||||
| { addLabel: LabelActionBody }
|
||||
// Label assosiation
|
||||
| { addChatLabel: ChatLabelAssociationActionBody }
|
||||
| { removeChatLabel: ChatLabelAssociationActionBody }
|
||||
|
||||
@@ -11,6 +11,18 @@ export interface Label {
|
||||
predefinedId?: string
|
||||
}
|
||||
|
||||
export interface LabelActionBody {
|
||||
id: string
|
||||
/** Label name */
|
||||
name?: string
|
||||
/** Label color ID */
|
||||
color?: number
|
||||
/** Is label has been deleted */
|
||||
deleted?: boolean
|
||||
/** WhatsApp has 5 predefined labels (New customer, New order & etc) */
|
||||
predefinedId?: number
|
||||
}
|
||||
|
||||
/** WhatsApp has 20 predefined colors */
|
||||
export enum LabelColor {
|
||||
Color1 = 0,
|
||||
|
||||
Reference in New Issue
Block a user