Open robl95405 opened 5 years ago
I don't know who wrote this silliness, but they didn't plan very well. Ideally, Send-SlackApi
should handle paging, instead of nonsense like including it in individual functions. Although, looking at it, seems like it's context specific (See $PageDirection fun.
Totally open to a pull request that supports this! I have no use for it at $work or $home, so probably won't pop up on my todo list, unfortunately.
Even if there's a better way, feel free to borrow from the code linked above to just get something working, I'm not too picky.
Cheers!
Agreed and thanks! I have the paging wrappers in my perl scripts. I've asked Keith for help in generating a pull request, not sure my powershell abilities are up to production standards. :)
This impacts this issue in PoshBot https://github.com/poshbotio/PoshBot/issues/184
details on the API is at https://api.slack.com/methods/users.list
Short of adding global paging support, this could probably be implemented similarly to https://github.com/RamblingCookieMonster/PSSlack/pull/90
Yeah, that would help as a short-term solution. The PR linked above would help long-term (some sort of global pagination) - #91
Cheers!
@RamblingCookieMonster - is this going to be merged soon? we have a weird setup in our environment where slack users names don't always match their AD samaccountname value. When we try to use this module to send users messages via slack, it errors out for those users with non-matching slack usernames and AD samaccountname.
I tried using the get-slackuser function to return a list of usernames so that i can use that to compare against the AD name but im not able to retrieve all usernames that start with "za*". I'm thinking it's because of the pagination thing.
Which! #91 is a WIP I think, @rkeithhill might know more about the current state.
If you want to implement a quick bandaid, we could get that in as well (like Brandon mentioned, #90 seems similar and may help)
Cheers!
ahh yeah i'll wait for #91. For now I'm manually hardcoding one off issues in my script.
Ping!
Calling Get-Slackuser is only returning the first page of users. Would it be possible for you to do the paging in this routine and return the final, complete set? Please, please? :)