Merge pull request #543 from PauloAK/history-set-message-status

Adicionado message.status ao webhook MESSAGES_SET
This commit is contained in:
Davidson Gomes 2024-04-18 16:05:44 -03:00 committed by GitHub
commit 234a2c71b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 0 deletions

View File

@ -32,6 +32,7 @@ export class MessageRaw {
source_reply_id?: string;
chatwoot?: ChatwootMessage;
contextInfo?: any;
status?: wa.StatusMessage | any;
}
type MessageRawBoolean<T> = {

View File

@ -1001,6 +1001,15 @@ export class BaileysStartupService extends WAStartupService {
continue;
}
const status: Record<number, wa.StatusMessage> = {
0: 'ERROR',
1: 'PENDING',
2: 'SERVER_ACK',
3: 'DELIVERY_ACK',
4: 'READ',
5: 'PLAYED',
};
messagesRaw.push({
key: m.key,
pushName: m.pushName || m.key.remoteJid.split('@')[0],
@ -1009,6 +1018,7 @@ export class BaileysStartupService extends WAStartupService {
messageType: getContentType(m.message),
messageTimestamp: m.messageTimestamp as number,
owner: this.instance.name,
status: m.status ? status[m.status] : null,
});
}