Markoudstaal / node-red-contrib-discord-advanced

Recieve, send, edit and delete Discord messages in node-red.
MIT License
46 stars 16 forks source link

listen message "reply to messages" #15

Closed MrThiemann closed 2 years ago

MrThiemann commented 2 years ago

Hey,

is it possible to only intercept the messages when someone replies to a message? Example: User "a" sends instructions. User "B" wants to say thank you and replies to the message from user "a" with "thx" .... And this is exactly the message I want to intercept in order to be able to continue working with my bot. But much more! i don't just want to see that user B writes "thx", but rather that it is "a response to the message from user a".

do you understand how i mean?

juanhaywood commented 2 years ago

It's possible with discord.js api: message.type=19 (reference: types)

But not sure if it aligns with what @Markoudstaal envisions for this NR add-on.

Markoudstaal commented 2 years ago

As juan states you can check if the type is a reply with message.type, which is available under msg.data.type in this node. Additionally dcef5d7 now give you the reference object, available under msg.data.reference. This object will contain the orginal messageID of the message that was replied to.