Merge pull request #208 from chrisedington/ce/slack-archive-fix

Fix: Don't include archived Slack channels
This commit is contained in:
Chris Weaver 2023-07-19 21:47:25 -07:00 committed by GitHub
commit 4958962855
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,10 +44,10 @@ def get_channel_info(client: WebClient, channel_id: str) -> ChannelType:
]
def get_channels(client: WebClient) -> list[ChannelType]:
def get_channels(client: WebClient, exclude_archived: bool = True) -> list[ChannelType]:
"""Get all channels in the workspace"""
channels: list[dict[str, Any]] = []
for result in _make_slack_api_call(client.conversations_list):
for result in _make_slack_api_call(client.conversations_list, exclude_archived=exclude_archived):
channels.extend(result["channels"])
return channels