Currently, any API call that requires a channel (or a group or a user) starts by making a lookup call. In this call, any failure response is silently replaced with channel_not_found (or user_not_found) which leads to much confusion when trying to figure out why something isn't working.
For lookupk to pass through all the errors it gets without running into type trouble, all the list functions it's passed must have the same set of errors in their return types. I checked slack's API documentation to see if groups_list actual needs the bot_error in its signature. Both https://api.slack.com/methods/groups.list and https://api.slack.com/bot-users indicate that it doesn't, so I removed it. (I did the same for im_list even it isn't used with lookupk, because it probably should be at some point.)
There's probably some more cleanup that could be done here, but I didn't want to change too much before getting a review. :-)
Currently, any API call that requires a channel (or a group or a user) starts by making a lookup call. In this call, any failure response is silently replaced with
channel_not_found
(oruser_not_found
) which leads to much confusion when trying to figure out why something isn't working.For
lookupk
to pass through all the errors it gets without running into type trouble, all the list functions it's passed must have the same set of errors in their return types. I checked slack's API documentation to see ifgroups_list
actual needs thebot_error
in its signature. Both https://api.slack.com/methods/groups.list and https://api.slack.com/bot-users indicate that it doesn't, so I removed it. (I did the same forim_list
even it isn't used withlookupk
, because it probably should be at some point.)There's probably some more cleanup that could be done here, but I didn't want to change too much before getting a review. :-)