Added option for forcing message id

This commit is contained in:
Dmitry Sadovsky
2020-12-28 13:41:27 +03:00
parent 5fb9e8abed
commit 165451d752
2 changed files with 4 additions and 2 deletions

View File

@@ -260,7 +260,7 @@ export class WAConnection extends Base {
key: {
remoteJid: id,
fromMe: true,
id: generateMessageID(),
id: options?.messageId || generateMessageID(),
},
message: message,
messageTimestamp: timestamp,

View File

@@ -377,6 +377,8 @@ export interface MessageOptions {
/** Should it send as a disappearing messages.
* By default 'chat' -- which follows the setting of the chat */
sendEphemeral?: 'chat' | boolean
/** Force message id */
messageId?: string
}
export interface WABroadcastListInfo {
status: number
@@ -474,4 +476,4 @@ export type BaileysEvent =
'received-pong' |
'credentials-updated' |
'connection-validated' |
'blocklist-update'
'blocklist-update'