Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I need to know each message, when and who read it #418

Closed
mygethu opened this issue Nov 6, 2020 · 6 comments
Closed

I need to know each message, when and who read it #418

mygethu opened this issue Nov 6, 2020 · 6 comments
Labels
enhancement New feature or request

Comments

@mygethu
Copy link

mygethu commented Nov 6, 2020

hi bro
I need to know each message, when and who read it

There are detailed information in the information card of the whatsup app, showing the details of the reader, can it be easily obtained in large quantities?

@mygethu mygethu added the enhancement New feature or request label Nov 6, 2020
@guicuton
Copy link
Contributor

guicuton commented Nov 9, 2020

See this:
message_ack

@mygethu
Copy link
Author

mygethu commented Nov 9, 2020

no simple

@mygethu
Copy link
Author

mygethu commented Nov 9, 2020

i want like this
other “Baileys - Typescript/Javascript WhatsApp Web API”
/** Get the message info, who has read it, who its been delivered to */
@mutex ((jid, messageID) => jid+messageID)
async messageInfo (jid: string, messageID: string) {
const query = ['query', {type: 'message_info', index: messageID, jid: jid, epoch: this.msgCount.toString()}, null]
const response = (await this.query ({json: query, binaryTags: [22, WAFlag.ignore], expect200: true}))[2]

    const info: MessageInfo = {reads: [], deliveries: []}
    if (response) {
        const reads = response.filter (node => node[0] === 'read')
        if (reads[0]) {
            info.reads = reads[0][2].map (item => item[1])
        }
        const deliveries = response.filter (node => node[0] === 'delivery')
        if (deliveries[0]) {
            info.deliveries = deliveries[0][2].map (item => item[1])
        }
    }
    return info
}
/**

@mygethu
Copy link
Author

mygethu commented Nov 9, 2020

but i want to use this one

@mygethu
Copy link
Author

mygethu commented Nov 9, 2020 via email

@guicuton
Copy link
Contributor

guicuton commented Nov 9, 2020

message_ack has the message properties that has been affected and inside of message properties you have the author and destinatary info.

The message_ack is emitted when an ack event occurrs on message that you've sent.
But if you want count how many messages some number has received and readed from you, maybe, you can try use fetchMessage

this will give you a list of messages between you and a given destinatary.
There's the message properties that you can use to count the message volume and sort it by* acks*

tianvier added a commit to tianvier/whatsapp-web.js that referenced this issue Dec 31, 2020
* 'master' of https://github.com/pedroslopez/whatsapp-web.js:
  chore: mark version v1.12.0
  docs: switch links to point to the guide
  docs: fix error generating Label docs
  feat: Get message delivery information (close pedroslopez#418)
  feat: mark chat as unread (pedroslopez#475)
  feat: add GroupChat types (pedroslopez#485)
  docs: fix typo
  feat: added starred indicator to messages (pedroslopez#501)
  feat: star/unstar messages (pedroslopez#494)
  feat: get Contact's "About" text (close pedroslopez#491)
  feat: get links included in message (pedroslopez#457)
  feat: send media as stickers (pedroslopez#479)
  docs: fix slight typo
  feat: send media as document (pedroslopez#490)
  feat: Get registered ID for a given phone number (pedroslopez#483)
  feat(interface): Open chat search, open chat at message position (pedroslopez#447)
  feat: WA Business Labels support (pedroslopez#407)

# Conflicts:
#	package.json
Belfio pushed a commit to Belfio/whatsapp-web.js that referenced this issue Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants