Writing a slack bot and I would like to be able to get a list of all the channels my bot is a member of. One way to do this is to call https://slack.com/api/channels.list
, get a (potentially large) list of all channels and then search for the channels that the current (bot) user is a member of. This works fine, but seems very heavy handed.
Is there a better way? To get just the channels that a given user is a member of?
I think users.conversations
is what you're looking for. Without additional params it will return all public channels the calling user is a member of.