I want to find thread message and delete it with slack-api

无人久伴 提交于 2020-04-16 02:26:54

问题


Private messages or Direct messages can be found with methods such as im.history and converstation.history.

How to find thread message? I want to find thread messages and delete them.


回答1:


Finding thread messages

You need to use the conversations.history method to retrieve the parent message of a thread.

And then the conversations.replies method to retrieve the thread including all thread messages for a parent message.

You can detect a parent message by looking on the ts and thread_ts properties:

When a message has a thread_ts value and it matches the same message's ts, the message is a thread parent.

For more information check out the official documentation: Finding message threads in the wild

Deleting thread messages

You can delete a thread message the same way as with normal message using the chat.delete method.



来源:https://stackoverflow.com/questions/52657092/i-want-to-find-thread-message-and-delete-it-with-slack-api

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!