简体   繁体   中英

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

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM