Closed dionelysterrero closed 1 year ago
@dionelysterrero
I would say it should work if you set message_thread_id in the options of the message.
e.g. msg.payload.options = { "message_thread_id" : 247 }
https://core.telegram.org/bots/api#sendmessage
I still can't get this to work using msg.payload.options it only goes to the general topic @windkh
Something like this msg.payload = { chatId : - 1001950884149, type :"message', content : statusMessage, options : { "message_thread_id" : 3 } return msg;
@LocalHappiness did it work for you?
It worked perfectly! Thanks for the quick response in resolving my issue.
It worked perfectly! Thanks....
For those who, like me, found this discussion and still did not immediately understand how to do this. I use "Change" node, select set payload.options.message_thread_id and set value thread id like number
Example for import to NodeRed, thread_id = 3
[{"id":"9ef478a08db0020e","type":"change","z":"010ef8baf06e3950","name":"Send_to_thread","rules":[{"t":"set","p":"payload.options.message_thread_id","pt":"msg","to":"3","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":160,"wires":[[]]}]
I use a function node:
[{"id":"fda32729892e9e6a","type":"function","z":"7f5313cf.c1dd7c","name":"Test Message","func":"testMessage = \"Test message to topicID\"\n\nmsg.payload = {\nchatId : -1001950884149,\ntype :\"message\",\ncontent : testMessage,\noptions : { \"message_thread_id\" : 702 }\n}\n\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1350,"y":1690,"wires":[["dd52de77d3ba07ee"]]}]
Is there a way to send a message to a group thread? I currently have a group with different threads (General, Notifications, etc.) and I want to send messages to the notification thread from node red. How can I implement the payload in node red?
I currently have this configuration, but the message reaches me in the general thread![image](https://user-images.githubusercontent.com/5863894/226001817-d1d54102-d520-4892-96e9-611f2f241774.png)