发送线程消息但也发送到频道
Send threaded message but also send to channel
发送消息时,可以将tmid
参数传递给API到post表示消息到另一条消息的线程:
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)
这相当于 message.tmid
parameter of the /api/v1/chat.sendMessage
入口点。
在线程中post发送消息的界面上,有一个复选框Also send to channel
:
但我在 Python 库或 REST API 文档中找不到任何等效项。
问题
如何以编程方式发送线程消息,该消息也被发送到频道,就好像上面的复选标记被打勾一样?
我运行遇到了同样的问题。终于通过搜索 Rocket.Chat source code 找到了它。
您可以传递一个 tshow
参数(必须设置为 true
),这正是您想要的。
发送消息时,可以将tmid
参数传递给API到post表示消息到另一条消息的线程:
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)
这相当于 message.tmid
parameter of the /api/v1/chat.sendMessage
入口点。
在线程中post发送消息的界面上,有一个复选框Also send to channel
:
但我在 Python 库或 REST API 文档中找不到任何等效项。
问题
如何以编程方式发送线程消息,该消息也被发送到频道,就好像上面的复选标记被打勾一样?
我运行遇到了同样的问题。终于通过搜索 Rocket.Chat source code 找到了它。
您可以传递一个 tshow
参数(必须设置为 true
),这正是您想要的。