Fix: Don't include archived Slack channels, as they cannot be called on conversations.join API

This commit is contained in:
Chris Edington 2023-07-18 22:04:30 +02:00
parent c6bcd5e1aa
commit dac2fdc163

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