在 Bot Framework 中存储用户数据
Storing User data in Bot Framework
如何在频道上存储用户的状态信息,并在 bot 框架的后续对话中始终使用它?
我应该在哪里调用 SetUserData()
?在我的一个对话框(如果不调用此对话框怎么办)或 MessageController 中?
The Bot State service enables your bot to store and retrieve state
data that is associated with a user, a conversation, or a specific
user within the context of a specific conversation.
为了存储一些数据:
IDialogContext cxt;
cxt.UserData.SetValue(key, value);
稍后您可以检索:
IDialogContext cxt;
string result;
cxt.UserData.TryGetValue(key, out result);
如何在频道上存储用户的状态信息,并在 bot 框架的后续对话中始终使用它?
我应该在哪里调用 SetUserData()
?在我的一个对话框(如果不调用此对话框怎么办)或 MessageController 中?
The Bot State service enables your bot to store and retrieve state data that is associated with a user, a conversation, or a specific user within the context of a specific conversation.
为了存储一些数据:
IDialogContext cxt;
cxt.UserData.SetValue(key, value);
稍后您可以检索:
IDialogContext cxt;
string result;
cxt.UserData.TryGetValue(key, out result);