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

feat: Added WPP.chat.getReactions function #811

Merged
merged 3 commits into from Dec 13, 2022
Merged

feat: Added WPP.chat.getReactions function #811

merged 3 commits into from Dec 13, 2022

Conversation

icleitoncosta
Copy link
Contributor

@icleitoncosta icleitoncosta commented Dec 13, 2022

Opa Edgar, boa noite.

Acabei encontrando a função getReactions dentro do WaSource, como vi que ainda não estava exportada uma forma de poder recuperar as reações sem ser via evento, exportei a função.

Também formatei para manter o mesmo padrão que existe hoje nas reações.

Abraços

Segue exemplo de retorno:

{
    "reactionByMe": {
        "id": "true_554399796xxxxxxx65@g.us_3A20C171F95BAC17BD03_5521985232927@c.us",
        "orphan": 0,
        "msgId": "true_554399796xxxxxxx565@g.us_3EB085CF1223CA436A9D_5521985232927@c.us",
        "reactionText": "😮",
        "read": true,
        "senderUserJid": "55219xxxxxxx7@c.us",
        "timestamp": 1670901209924
    },
    "reactions": [
        {
            "aggregateEmoji": "😮",
            "hasReactionByMe": true,
            "senders": [
                {
                    "id": "true_55439xxxxxxx635886565@g.us_3A20C171F95BAC17BD03_5521985232927@c.us",
                    "msgId": "true_554xxxxxxx0-1635886565@g.us_3EB085CF1223CA436A9D_5521985232927@c.us",
                    "reactionText": "😮",
                    "read": true,
                    "sender": "55xxxxxxx27@c.us",
                    "orphan": 0,
                    "timestamp": 1670901209924
                },
                {
                    "id": "false_55439979xxxxxxx6565@g.us_3EB00F9DE61B20B426EA_557191837508@c.us",
                    "msgId": "true_554399796xxxxxxx565@g.us_3EB085CF1223CA436A9D_5521985232927@c.us",
                    "reactionText": "😮",
                    "read": true,
                    "sender": "55719xxxxxxx@c.us",
                    "orphan": 0,
                    "timestamp": 1670901300000
                }
            ]
        },
        {
            "aggregateEmoji": "🍏",
            "hasReactionByMe": false,
            "senders": [
                {
                    "id": "false_55439979xxxxxxx6565@g.us_3AEA4E2EE7569FC562BE_553194359434@c.us",
                    "msgId": "true_55439xxxxxxx565@g.us_3EB085CF1223CA436A9D_5521985232927@c.us",
                    "reactionText": "🍏",
                    "read": true,
                    "sender": "553xxxxxxx4@c.us",
                    "orphan": 0,
                    "timestamp": 1670901312423
                }
            ]
        }
    ]
}

@edgardmessias edgardmessias changed the title feat: Added WPP.chat.getReactions feat: Added WPP.chat.getReactions function Dec 13, 2022
@edgardmessias edgardmessias merged commit 422da5f into wppconnect-team:main Dec 13, 2022
@icleitoncosta icleitoncosta deleted the getReactions branch December 13, 2022 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants