Merge pull request #295 from dimailn/force-message-id

Added option for forcing message id
This commit is contained in:
Adhiraj Singh
2020-12-29 10:54:20 +05:30
committed by GitHub
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'