You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is more like a question than an issue.
Sometimes there is no way for a bot to create a new channel by NAME because it is already created, and no way to get the Channel without fetching all channels list and iterating through most of them to get the channel you want.
What type of issue is this?
bug
enhancement (feature request)
question
documentation related
testing related
discussion
Requirements
I've read and understood the Contributing guidelines and have done my best effort to follow them.
Thanks for this. Completely get where you're coming from. However this is more to do with the information our API returns for the *.create endpoints. You may be able to do similar yourself by calling the create api call and if you get that error, you run *.list and iterate over the results until you find a matching channel name. It would depend on pagination too however.
The one thing to be aware of, the channels.* and groups.* endpoints are being retired in place of conversations.*. This endpoint allows you to check both private and public channels provided you have access to them.
I will mention to our product managers that you'd like this to happen but I'm afraid at the moment, I think this would be out of scope for the SDK itself.
It makes no sense to iterate over more than 7K channels to get the right one, fetching all channels, I think there can be a better way to filter the channels.list based on name or something ?
Reacted by John Paton, Laureano Sánchez Aguilar, sharmautkarsh31, chillipeper, Joseph Sturtevant, Rupesh Reddy, Bryan Seitz, David Trejo, Mikhail Verbitsky, Joshua Chan and 8 more
I have hit this issue as well - the API is definitely deficient in this respect. As @gothraven points out there should be a way to search for channel(s) by name.
Reacted by Safiy Zaghbane, Laureano Sánchez Aguilar, sharmautkarsh31, chillipeper, Bryan Seitz, David Trejo, Mikhail Verbitsky, Brad Murry and Sergio Mayorga || Mayo
Also just ran into this. Making loads of api calls and iterating over thousands of channels just to find the ID that matches the name I have seems... inefficient.
Reacted by Safiy Zaghbane, Laureano Sánchez Aguilar, sharmautkarsh31, chillipeper, Dmitry Burlyaev, adhika-sigit, Bryan Seitz, David Trejo, Mikhail Verbitsky and Brad Murry
search.messages is not just a workaround, but also won't work with a bot token — it requires a user token. You could create a dummy user for this purpose, but there's a dark corner in hell reserved for whomever dares.
Activity
lavabyrd commentedon May 3, 2019
Hey @gothraven ,
Thanks for this. Completely get where you're coming from. However this is more to do with the information our API returns for the
*.createendpoints. You may be able to do similar yourself by calling the create api call and if you get that error, you run*.listand iterate over the results until you find a matching channel name. It would depend on pagination too however.The one thing to be aware of, the
channels.*andgroups.*endpoints are being retired in place ofconversations.*. This endpoint allows you to check both private and public channels provided you have access to them.I will mention to our product managers that you'd like this to happen but I'm afraid at the moment, I think this would be out of scope for the SDK itself.
Thanks for your feedback and information however!
gothraven commentedon May 3, 2019
It makes no sense to iterate over more than 7K channels to get the right one, fetching all channels, I think there can be a better way to filter the channels.list based on name or something ?
amilbourne commentedon Nov 6, 2019
I have hit this issue as well - the API is definitely deficient in this respect. As @gothraven points out there should be a way to search for channel(s) by name.
acurt1 commentedon Apr 29, 2020
Same issue here. Is there any update or still need to iterate?
JohnPaton commentedon Jun 25, 2020
Also just ran into this. Making loads of api calls and iterating over thousands of channels just to find the ID that matches the name I have seems... inefficient.
zachsirotto commentedon Sep 23, 2020
use https://api.slack.com/methods/search.messages
kalrish commentedon Oct 8, 2021
This limitation is unfortunate and unfortunately still there.
search.messagesis not just a workaround, but also won't work with a bot token — it requires a user token. You could create a dummy user for this purpose, but there's a dark corner in hell reserved for whomever dares.