-
Notifications
You must be signed in to change notification settings - Fork 634
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
Persist more user data from Slack in the brain #229
Conversation
This is pretty nifty, though I’d vote for it to not be namespaces under |
Yeah, I can definitely appreciate that. However, this is what holds me back:
Given that, I think it makes sense to store it under a namespace. That way, it's really easy to update the entire object (just stash the new data on I will also mention, it's worth keeping |
Makes sense. Definitely safer to namespace; you've convinced me. |
email_address: user.profile.email | ||
slack: {} | ||
for key, value of user | ||
# user contains an of the SlackClient, which and contains references to the all the data types (users, channels) plus things like the token, s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this line needs an update! I couldn't get it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I edited this a few times, and ended up with word soup 😓 Here's what I think I was trying to say originally:
user contains an instance of the Slack, which
containsreferences to all the data types
I'll take another pass at describing it.
Merge pull request #229 from github/persist-more-slack-user-data Persist more user data from Slack in the brain
Would love to know when this ships in a new version, I can make great use of it in a few scripts of mine! |
Now live in 3.4.1. |
I wanted access to more details about a user in order to write listener middleware for doing things like blocking access for restricted and bot users.
The data is there in hubot-slack, but just not put into hubot's brain. I had considered just adding everything to the user object at the top level, but I think it'd be better to namespace it under
slack
, so it doesn't seem like that's something a script author should be manipulating.Here's what it looks like slackbot looks like: