feat: add chat.getUser() for cross-platform user lookups#391
feat: add chat.getUser() for cross-platform user lookups#391
Conversation
Add UserInfo type and optional getUser() method to the Adapter interface. Implement on Slack (extends existing lookupUser with email/avatar), Discord, Google Chat, GitHub, Linear, and Telegram adapters. Add "Who Am I" button to the example app demonstrating the feature. Update docs with getUser API reference and usage examples.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@heyitsaamir any chance we can add Teams support for this? |
It should be possible! const member = await app.api.conversations
.members(activity.conversation.id)
.getById(activity.from.id);Lmk if that doesn't work! |
|
So the above will get you the member, but it requires the conversation id. Members in Teams aren't global members, but more based on membership of a conversation. If you want global members, you can do that via graph, but it'll require some graph permissions i believe ( const graphUser = await app.graph.call(endpoints.users.get({ 'user-id': activity.from.aadObjectId! })); |
Ah thank you for this! Do you by any chance have time to push it to the PR? Mainly ask as you'd know exactly which methods to use and what to troubleshoot accordingly |
- slack: return null from lookupUser on failure instead of fallback object, removing the isBot === undefined sentinel in getUser - slack: use image_192 instead of image_72 for better avatar quality - gchat: cache avatarUrl from webhook sender payload - gchat: return avatarUrl in getUser response - gchat: fix tests to use current cache format with isBot field - docs: document null return, fix example to use message.author
Give me a couple of days :). I can include it after this PR goes in? |
That'd be perfect, thank you so much! |
UserInfotype and optionalgetUser()method to theAdapterinterfacenullwhen user not found, throwsChatError("NOT_SUPPORTED")for adapters without supportUserInfotype table, and error handling examples