Can't call api_call('conversations.list', exclude_archived=1)
slackclient==2.9.3
Python 3.7.9
FreeBSD 12.2-RELEASE-p2 amd64
def get_bot_channels(self):
channels = self.sc.api_call('conversations.list', exclude_archived=1)
channels_list = channels['channels']
memberships = []
for channel in channels_list:
if self.SLACK_BOT_ID in channel['members']:
memberships.append(channel['id'])
return memberships
Exclude archived conversations.
TypeError: api_call() got an unexpected keyword argument 'exclude_archived'
Hi @alvawa27 馃憢馃徎 thanks for providing the details and code sample (it always helps out a lot)!
When using the api_call method, you can pass the extra params with the json key:
response = client.api_call(
api_method='conversations.list',
json={ 'exclude_archived': 1 }
)
Here are more detailed docs:
Would you mind giving that suggestion a try and letting me know how it goes? Thanks!
That worked perfectly. Thank you.
Most helpful comment
That worked perfectly. Thank you.