poshbotio / PoshBot

Powershell-based bot framework
MIT License
540 stars 108 forks source link

Can't Retrieve More Than 1000 Slack Users #184

Open zollo opened 5 years ago

zollo commented 5 years ago

Expected Behavior

PoshBot should be able to work with any number of users in the Slack workspace.

Current Behavior

PoshBot can only retrieve 1000 users.

Possible Solution

This is likely due to incorrect pagination via the Slack API.

Steps to Reproduce (for bugs)

Launch PoshBot and connect to a Slack workspace with > 1000 users.

Context

With the 1000 user limit, most users are not able to leverage the bot, we see errors that the user can't be identified. I'm in several Slack spaces with >1000 users so this would be a breaking issue.

Your Environment

PowerShell 5.1 on Windows Server 2019, same issue on Windows 10 1903.

kilasuit commented 5 years ago

This is likely a PSSlack issue that is just being surfaced in PoshBot

Can you try using PSSlack and getting all the users in your slack instance via that?

kilasuit commented 5 years ago

Looking into this as mentioned it is an issue with PSSlack / the actual Slack API implementation for returning users

zollo commented 5 years ago

Confirmed - this is not a PoshBot issue! Get-SlackUser only returns 1000 users.

devblackops commented 5 years ago

Probably an straightforward fix if someone wants to add paging support similarly to how I did it for channels. https://github.com/RamblingCookieMonster/PSSlack/pull/90. We pin to a specific version of PSSlack so once that is released, we can bump the dependency and have it in the v0.12.0 release (which adds Discord support as well).

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.