Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is subtype the right event field to inspect? #12

Open
reillysiemens opened this issue Nov 14, 2017 · 1 comment
Open

Is subtype the right event field to inspect? #12

reillysiemens opened this issue Nov 14, 2017 · 1 comment
Labels

Comments

@reillysiemens
Copy link
Owner

As it turns out, when a user joins a group multiple events are fired. There's a simple event:

{'channel': 'G1A8FU8AF',
 'channel_type': 'G',
 'event_ts': '1510652911.000174',
 'inviter': 'U03QJJHES',
 'ts': '1510652911.000174',
 'type': 'member_joined_channel',
 'user': 'U03YZLA0F'}

and a more complex event that fires later:

[{'channel': 'G1A8FU8AF',
  'event_ts': '1510652911.000182',
  'inviter': 'U03QJJHES',
  'subtype': 'group_join',
  'team': 'T03ZKJJPR',
  'text': '<@U03YZLA0F> has joined the group',
  'ts': '1510652911.000182',
  'type': 'message',
  'user': 'U03YZLA0F',
  'user_profile': {'avatar_hash': 'fe4afee620eb',
   'display_name': 'someuser',
   'first_name': 'Some',
   'image_72': 'https://avatars.slack-edge.com/2016-12-19/119019590852_fe4afee620dzff3d6cbe_72.png',
   'is_restricted': False,
   'is_ultra_restricted': False,
   'name': 'someuser',
   'real_name': 'Some User',
   'team': 'T03ZKJJPR'}}]

Should the bot actually match the first event rather than looking at subtypes of the message event? My gut says yes, but I haven't identified whether this is that same for a member_joined_group event? Does such a thing exist? Would there be missing context we could gain from the message event? I'm guessing nothing we couldn't get if we just did a lookup on the user from the first type of event. 🤔

@reillysiemens
Copy link
Owner Author

There's no member_joined_group event. Both private and public channels are encompassed by the member_joined_channel event which, it would appear, is the right thing to do. Further documentation on that event can be found here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant