We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The text was updated successfully, but these errors were encountered:
现在 hubot rtm 得到的结构里 res.message 如下:
TextMessage { user: User { id: '=bw52Q', message: { created_ts: 1491987937546, image: '', instance_no: 1, instance_seq: 9, key: '1491987937546.0109', refer_key: null, subtype: 'normal', text: 'badger', to_uid: '=bwNZS', ts: 1491987937546, type: 'message', uid: '=bw52Q', unknown_before: false, vchannel_id: '=ofw7Ae' }, room: { vchannelId: '=ofw7Ae' }, name: '=bw52Q' }, text: 'hubot-secretary badger', id: '1491987937546.0109', done: false, room: { vchannelId: '=ofw7Ae' } }
res.envelope 结构如下:
{ room: { vchannelId: '=ofw7Ae' }, user: User { id: '=bw52Q', message: { created_ts: 1491987937546, image: '', instance_no: 1, instance_seq: 9, key: '1491987937546.0109', refer_key: null, subtype: 'normal', text: 'badger', to_uid: '=bwNZS', ts: 1491987937546, type: 'message', uid: '=bw52Q', unknown_before: false, vchannel_id: '=ofw7Ae' }, room: { vchannelId: '=ofw7Ae' }, name: '=bw52Q' }, message: TextMessage { user: User { id: '=bw52Q', message: [Object], room: [Object], name: '=bw52Q' }, text: 'hubot-secretary badger', id: '1491987937546.0109', done: false, room: { vchannelId: '=ofw7Ae' } } }
Sorry, something went wrong.
研究完了 hubot-auth 的原理,它本身是依赖于 hubot.brain.users 的。brain 里需要存一份用户列表(基于现在的 brain 实现这个还是持久化的)。 hobot 的 slack adapter 里是支持的,它一上来就调用 API 获取一份 users 列表 ,并且用 slack-client 监听用户更新。(https://github.com/slackapi/hubot-slack/pull/381/files) 我们要想也走同样的方案,就要做同样的事情。
hubot.brain.users
另外还有一个方案是自己 fork hubot-auth 或做一套独立的认证,不基于 hubot.brain.users 实现。这个做起来会比较容易,就是有点原理社区的生态。
loddit
No branches or pull requests
考察插件
The text was updated successfully, but these errors were encountered: