dblock / slack-sup

Slack bot that generates fresh triads of team members to meet every week in an informal standup, or S'Up.
https://sup.playplay.io/
Other
19 stars 10 forks source link

Give users an option to not meet certain people, such as in their team #5

Closed dblock closed 7 years ago

dblock commented 7 years ago

cc: @orta, this is where we'd want team information in a custom field in slack

orta commented 7 years ago

You should be able to specify on your side, a profile attribute where you don't meet someone with the same value

dblock commented 7 years ago

User profiles are retrieved via users_profile_get and require a scoped access token, added in https://github.com/dblock/slack-sup/commit/654af305945716da99c47d6b96fdb34aa8091167 (also see https://github.com/slack-ruby/slack-ruby-bot-server/issues/66).

team = Team.last

client = Slack::Web::Client.new(token: team.token)
members = client.paginate(:users_list, presence: false).map(&:members).flatten
dblock = members.detect { |m| m.name == 'dblock' }

client = Slack::Web::Client.new(token: team.access_token)
profile = client.users_profile_get(user: dblock.id)
dblock commented 7 years ago

This was implemented in https://github.com/dblock/slack-sup/commit/bf119b75db14b507855beefbbfa491cb26d981c8, @orta all we need to is to sync the data into Slack.