DialogFlow V2 user id?

一曲冷凌霜 提交于 2019-12-07 17:53:52

问题


Is there a way to track user Id between conversations without requiring the user to connect their Google account? Like an anon userId. I don't see any id field in the docs: https://dialogflow.com/docs/fulfillment#request


回答1:


According to the latest usage, conv.user.id is DEPRECATED: Use conv.user.storage to store data instead

For more details, have a look at this answer by Prisoner.




回答2:


you can get userId like this:

let userId = conv.user.id;

Sample intent:

app.intent(INTENT_DEFAULT_WELCOME, conv => { 
    let id = conv.user.id;         
    conv.ask(`Welcome ${id}`);
})


来源:https://stackoverflow.com/questions/49962924/dialogflow-v2-user-id

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!