Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exclude bot users from slack search api results

In the slack UI, when I make a search, it makes a request to the search.modules endpoint. There's also the option to exclude apps and bots from the result, which translates to a boolean POST param to that api endpoint.

https://api.slack.com/methods doesn't list such a method, and only has search.messages, search.files, and search.all.

How can I use the API to search, but exclude bot accounts? Do I need to leverage this seemingly hidden search.modules (which probably is inaccessible with a bot acct)? Is there a better way than making a list of bots and manually filtering them out of search results?

like image 388
1419636215 Avatar asked Jan 30 '26 06:01

1419636215


1 Answers

Well it's not in the documentation anywhere, but I can achieve this with the search.messages api by adding search_exclude_bots=True to my POST data.

Since this is undocumented, I'm curious as to whether users should be using this param and if it will be changed in a breaking way in the future.

like image 65
1419636215 Avatar answered Feb 03 '26 11:02

1419636215