11"""A Python module for interacting with Slack's Web API."""
22import os
33from io import IOBase
4- from typing import Union , Sequence , Optional , Dict
4+ from typing import Union , Sequence , Optional , Dict , Tuple
55
66import slack_sdk .errors as e
77from slack_sdk .models .views import View
@@ -168,7 +168,7 @@ def admin_conversations_invite(
168168 user_ids (str or list): The users to invite.
169169 """
170170 kwargs .update ({"channel_id" : channel_id })
171- if isinstance (user_ids , list ):
171+ if isinstance (user_ids , ( list , Tuple ) ):
172172 kwargs .update ({"user_ids" : "," .join (user_ids )})
173173 else :
174174 kwargs .update ({"user_ids" : user_ids })
@@ -488,7 +488,7 @@ def admin_teams_settings_setDefaultChannels(
488488 At least one channel is required. e.g. ['C1A2B3C4D', 'C26Z25Y24']
489489 """
490490 kwargs .update ({"team_id" : team_id })
491- if isinstance (channel_ids , list ):
491+ if isinstance (channel_ids , ( list , Tuple ) ):
492492 kwargs .update ({"channel_ids" : "," .join (channel_ids )})
493493 else :
494494 kwargs .update ({"channel_ids" : channel_ids })
@@ -563,7 +563,7 @@ def admin_usergroups_addChannels(
563563 channel_ids (str or list): Comma separated string of channel IDs. e.g. 'C123,C234' or ['C123', 'C234']
564564 """
565565 kwargs .update ({"team_id" : team_id , "usergroup_id" : usergroup_id })
566- if isinstance (channel_ids , list ):
566+ if isinstance (channel_ids , ( list , Tuple ) ):
567567 kwargs .update ({"channel_ids" : "," .join (channel_ids )})
568568 else :
569569 kwargs .update ({"channel_ids" : channel_ids })
@@ -581,7 +581,7 @@ def admin_usergroups_addTeams(
581581 e.g. 'T12345678,T98765432' or ['T12345678', 'T98765432']
582582 """
583583 kwargs .update ({"usergroup_id" : usergroup_id })
584- if isinstance (team_ids , list ):
584+ if isinstance (team_ids , ( list , Tuple ) ):
585585 kwargs .update ({"team_ids" : "," .join (team_ids )})
586586 else :
587587 kwargs .update ({"team_ids" : team_ids })
@@ -608,7 +608,7 @@ def admin_usergroups_removeChannels(
608608 channel_ids (str or list): Comma separated string of channel IDs. e.g. 'C123,C234' or ['C123', 'C234']
609609 """
610610 kwargs .update ({"usergroup_id" : usergroup_id })
611- if isinstance (channel_ids , list ):
611+ if isinstance (channel_ids , ( list , Tuple ) ):
612612 kwargs .update ({"channel_ids" : "," .join (channel_ids )})
613613 else :
614614 kwargs .update ({"channel_ids" : channel_ids })
@@ -643,7 +643,7 @@ def admin_users_invite(
643643 At least one channel is required. e.g. ['C1A2B3C4D', 'C26Z25Y24']
644644 """
645645 kwargs .update ({"team_id" : team_id , "email" : email })
646- if isinstance (channel_ids , list ):
646+ if isinstance (channel_ids , ( list , Tuple ) ):
647647 kwargs .update ({"channel_ids" : "," .join (channel_ids )})
648648 else :
649649 kwargs .update ({"channel_ids" : channel_ids })
@@ -1162,7 +1162,7 @@ def conversations_invite(
11621162 users (str or list): An list of user id's to invite. e.g. ['U2345678901', 'U3456789012']
11631163 """
11641164 kwargs .update ({"channel" : channel })
1165- if isinstance (users , list ):
1165+ if isinstance (users , ( list , Tuple ) ):
11661166 kwargs .update ({"users" : "," .join (users )})
11671167 else :
11681168 kwargs .update ({"users" : users })
@@ -1336,7 +1336,7 @@ def dnd_teamInfo(self, users: Union[str, Sequence[str]], **kwargs) -> SlackRespo
13361336 Args:
13371337 users (str or list): User IDs to fetch information e.g. 'U123,U234' or ["U123", "U234"]
13381338 """
1339- if isinstance (users , list ):
1339+ if isinstance (users , ( list , Tuple ) ):
13401340 kwargs .update ({"users" : "," .join (users )})
13411341 else :
13421342 kwargs .update ({"users" : users })
@@ -1431,7 +1431,7 @@ def files_remote_share(
14311431 channels (str or list): Comma-separated list of channel IDs where the file will be shared.
14321432 e.g. ['C1234567890', 'C2345678901']
14331433 """
1434- if isinstance (channels , list ):
1434+ if isinstance (channels , ( list , Tuple ) ):
14351435 kwargs .update ({"channels" : "," .join (channels )})
14361436 else :
14371437 kwargs .update ({"channels" : channels })
@@ -1696,7 +1696,7 @@ def migration_exchange(
16961696 users (str or list): A list of user ids, up to 400 per request.
16971697 e.g. ['W1234567890', 'U2345678901', 'U3456789012']
16981698 """
1699- if isinstance (users , list ):
1699+ if isinstance (users , ( list , Tuple ) ):
17001700 kwargs .update ({"users" : "," .join (users )})
17011701 else :
17021702 kwargs .update ({"users" : users })
@@ -1744,7 +1744,7 @@ def mpim_open(self, *, users: Union[str, Sequence[str]], **kwargs) -> SlackRespo
17441744 is preserved whenever a MPIM group is returned.
17451745 e.g. ['W1234567890', 'U2345678901', 'U3456789012']
17461746 """
1747- if isinstance (users , list ):
1747+ if isinstance (users , ( list , Tuple ) ):
17481748 kwargs .update ({"users" : "," .join (users )})
17491749 else :
17501750 kwargs .update ({"users" : users })
@@ -2076,7 +2076,7 @@ def usergroups_users_update(
20762076 users for the User Group. e.g. ['U060R4BJ4', 'U060RNRCZ']
20772077 """
20782078 kwargs .update ({"usergroup" : usergroup })
2079- if isinstance (users , list ):
2079+ if isinstance (users , ( list , Tuple ) ):
20802080 kwargs .update ({"users" : "," .join (users )})
20812081 else :
20822082 kwargs .update ({"users" : users })
0 commit comments