1

When sending a message, one can pass the tmid argument to the API to post said message to the thread of another message:

from rocketchat_API.rocketchat import RocketChat

rocket = RocketChat(server_url="(...)", user_id="...", auth_token="...")
room = "#my-channel"
response = rocket.chat_post_message("A message", room_id=room)
tmid = response.json()['message']['_id']

rocket.chat_post_message("A message in the previous message thread", room_id=room, tmid=tmid)

This is equivalent to the message.tmid parameter of the /api/v1/chat.sendMessage entry point.

On the interface for posting messages in a thread, there is a checkbox Also send to channel:

Also send to channel checkbox

But I can't find any equivalent either in the Python library or in the REST API documentation.

Question

How can I send a threaded message programmatically, that is also sent to the channel as if the above checkmark was ticked?

LeoRochael
  • 14,191
  • 6
  • 32
  • 38

1 Answers1

1

I ran into the same problem. Finally found it by searching the Rocket.Chat source code. You can pass a tshow parameter (must be set to true), which does exactly what you want.

Vince
  • 1,133
  • 3
  • 17
  • 34