mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-03-26 17:51:54 +01:00
Fix: Don't include archived Slack channels, as they cannot be called on conversations.join API
This commit is contained in:
parent
c6bcd5e1aa
commit
dac2fdc163
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user