Open jsdryan opened 3 years ago
Bottender didn't get profiles from platform automatically now. If you want to get profile from the use, use context.getProfile()
explicitly.
https://bottender.js.org/docs/en/api-line-context#profile-api---official-docshttpsdeveloperslinemeendocsmessaging-apireferenceget-profile https://developers.line.biz/en/reference/messaging-api/#get-profile
Bottender didn't get profiles from platform automatically now. If you want to get profile from the use, use
context.getProfile()
explicitly.https://bottender.js.org/docs/en/api-line-context#profile-api---official-docshttpsdeveloperslinemeendocsmessaging-apireferenceget-profile https://developers.line.biz/en/reference/messaging-api/#get-profile
Thank you! I can get displayName now by using the code:
const { displayName } = await context.getUserProfile();
Instead of:
const { displayName } = context.session.user;
But I'm wondering why author can get displayName
from context.session.user
:
https://ithelp.ithome.com.tw/articles/10222978
https://github.com/Yoctol/bottender/releases/tag/v1.0.0
[breaking] rename
skipProfile
toskipLegacyProfile
, and set to true by default
This was a breaking change introduced in v1.0.0
. Bottender before v1 will automatically get profile and put that into session.user
. That option is disabled by default after v1 release.
My code:![2021-06-06_01-29-41](https://user-images.githubusercontent.com/34669056/120900309-be80ad80-c666-11eb-9a62-7dc17fc19f97.png)
displayName
isundefined
, andcontext.session.user
has onlyid
and_updatedAt
properties.How can I get more information about user?