jorisvddonk/node-red-contrib-discord

Need help with mentioning a user in a message reply

Opened this issue · 2 comments

Any idea what the syntax is to send a message back and mention a user? I have not been able to find anything that explains how to do this, any help would be appreciated.

Read my issue @ #14
It explains how to mention a user

OK, quickest way is to mention the author.id

Here is a quick flow showing how mention works.

[{"id":"f60da9da.192078","type":"discordMessage","z":"719af26d.d47dcc","name":"BoT","token":"","x":300,"y":360,"wires":[["bef98450.bc2418","ec1d70d6.bd309"]]},{"id":"bef98450.bc2418","type":"debug","z":"719af26d.d47dcc","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":490,"y":360,"wires":[]},{"id":"853cb506.a7ea98","type":"discordSendMessage","z":"719af26d.d47dcc","name":"SendMessage","channel":"","token":"","x":800,"y":400,"wires":[]},{"id":"ec1d70d6.bd309","type":"function","z":"719af26d.d47dcc","name":"Simple Reply Message","func":"var MessengerID = msg.author.id;\nvar MessengerName = msg.author.username;\nvar mentionUser = <@+MessengerID+>;\nvar Msg2Send = Hello+MessengerName;\n\nnode.status({fill:"green",shape:"ring",text: "Messages Sent: "+Msg2Send});\n\nvar PL = mentionUser+Msg2Send\n\nmsg = {\n "payload": PL\n }\nreturn msg","outputs":1,"noerr":0,"x":540,"y":400,"wires":[["853cb506.a7ea98"]]}]