Comments (13)
So, let discuss about this, what we can do? Change the messages.reaction
to include empty reaction (remove) or create a new event (maybe messages.reaction.delete
)
👍 for update messages.reaction
with empty reaction
😄 for messages.reaction.delete
(or other name)
from baileys.
Well you have to manually record all the reactions and their sender id that a message has received
When receiving an empty reaction (ie. removing the reaction), then you can check what this sender's reaction emoji was.
from baileys.
It is documented, look at the link that I give you
https://whiskeysockets.github.io/Baileys/index.html
from baileys.
It is documented, look at the link that I give you https://whiskeysockets.github.io/Baileys/index.html
I would like an event to identify that the reaction has been removed.
The "messages.reaction" event does not fire when removing.
from baileys.
But the problem is that the "messages.reaction" event is not fired when the reaction is empty
Well you have to manually record all the reactions and their sender id that a message has received
When receiving an empty reaction (ie. removing the reaction), then you can check what this sender's reaction emoji was.
from baileys.
@IanosJunior The reason why the messages.reaction
event is not fired when the reactionMessage.text
is empty is probably in here, but I'm still trying to understand the code.
https://github.com/WhiskeySockets/Baileys/blob/54f8215eef2ec8911ac0fd71bdf5e2a362f98fcb/src/Utils/event-buffer.ts#LL433C27-L433C27
from baileys.
@IanosJunior Found it! The event-buffer
calls the util function updateMessageWithReaction
that in turn checks if the reaction text has a value before pushing the reaction to the message object:
Line 719 in 54f8215
Since the reactionMessage.text
is empty, it will not be pushed, and (I imagine that) when the event-buffer
gets flushed, the messages.reaction
is not fired because this specific reaction is not in the message's "reaction list".
from baileys.
@IanosJunior Found it! The
event-buffer
calls the util functionupdateMessageWithReaction
that in turn checks if the reaction text has a value before pushing the reaction to the message object:Line 719 in 54f8215
Since the
reactionMessage.text
is empty, it will not be pushed, and (I imagine that) when theevent-buffer
gets flushed, themessages.reaction
is not fired because this specific reaction is not in the message's "reaction list".
In this case, it would be better to remove this conditional to know when the reaction was removed.
What do you think @matheusb-comp ?
from baileys.
@IanosJunior Just removing this conditional would make these "reactions with empty text" to be added to the msg.reactions
array.
Since the updateMessageWithReaction
function is called in multiple points in the code (including the event-buffer
), I don't know what problems this could cause.
What I'm doing to handle this (in my custom "data-store") is to ignore the messages.reaction
event and emit custom events inside the sock.ev.on("messages.upsert", ...)
based on the message.reactionMessage.text
.
from baileys.
So, let discuss about this, what we can do? Change the
messages.reaction
to include empty reaction (remove) or create a new event (maybemessages.reaction.delete
)👍 for update
messages.reaction
with empty reaction 😄 formessages.reaction.delete
(or other name)
In the tests I did, just removing the conditional already solves the problem.
I don't know if it might impact storage.
from baileys.
So, let discuss about this, what we can do? Change the
messages.reaction
to include empty reaction (remove) or create a new event (maybemessages.reaction.delete
)👍 for update
messages.reaction
with empty reaction 😄 formessages.reaction.delete
(or other name)
So, will we have an update on this? I got myself stuck because of removed reactions aren't emitted.
from baileys.
Is this still an issue? Assigning myself to test this later!
from baileys.
Forgot to follow up, still an issue, will fix
from baileys.
Related Issues (20)
- How to stop the client asking for scanning QR Code
- Request Features Get All Chats and Get All Contact from Contacts and Groups
- [BUG] make-in-memory-store.ts missing contact names
- [BUG] reason: Error: bad-request client.profilePictureUrl() HOT 7
- [BUG] error bad-request when I try to get the profilePicture with profilePictureUrl("[email protected]") HOT 3
- [BUG] "waiting for message" resend issue. HOT 2
- [BUG] profilePictureUrl stop working since Jul.03 HOT 2
- [BUG] Connecting sessions to server HOT 2
- [BUG] Keeps Reconnecting Infinity Loop HOT 2
- [BUG] qrcode not printing because 405 error HOT 5
- [BUG] Session Keep Disconected HOT 1
- [BUG] error 428 Connection Closed when sending message to group HOT 2
- [BUG] Sending messages and listeners stop working HOT 2
- [BUG] Bad decrypt
- [BUG] Get profile picture url is broken HOT 6
- [BUG] commentMessage is not supported in the community HOT 6
- How to receive calls? HOT 1
- why error : Unterminated string in JSON HOT 2
- Error -> Request Time-out HOT 3
- [BUG] HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from baileys.