Skip to content

Commit

Permalink
Merge pull request #207 from randsleadershipslack/shared-channel-fail…
Browse files Browse the repository at this point in the history
…ures

handle slack channels shared with other teams
  • Loading branch information
royrapoport authored Feb 27, 2021
2 parents 80ec272 + 2e4bf54 commit fad15b8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion slacker.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,10 @@ def get_channel_member_names(self, channel_name):
returns an array of ["@member"] for members of the channel
"""
members = self.get_channel_members_ids(channel_name)
return ["@" + self.users_by_id[x] for x in members]
# Need to check if user is in users_by_id because a channel may be shared
# across Slack teams and the other Slack team's members would not be in
# this Slack team's user/member list.
return ["@" + self.users_by_id[x] for x in members if x in self.users_by_id]

def get_channel_info(self, channel_name):
"""
Expand Down

0 comments on commit fad15b8

Please sign in to comment.