rashi sonu
rashi sonu

Reputation: 1

how to store different response messages in different variable using botframework c#

I want to store username and password from users response for ex. in chatbot..

user: Reset my password
BOt: Enter your username?? 
user: guest --> this response should be stored in username variable
Bot: Enter your password??
user: 12345 --> this response should be stored in pass variable

How to do this in c# code botframework

Upvotes: 0

Views: 122

Answers (2)

sidecus
sidecus

Reputation: 752

I wrote a library which does this for you. In short the collected info is saved into Dialog options and in conversation data during turns assuming you are using personal (1-1) bots.

All these processing is done for you automatically and all you need to do is to declare what properties you need.

Link to repo

Upvotes: 0

Ezequiel Jadib
Ezequiel Jadib

Reputation: 14787

There are two alternatives:

  1. You can add global variables in your dialog and store the values there
  2. Use the BotBuilder's Data bags:
    • context.UserData
    • context.PrivateConversationData
    • context.ConversationData

Upvotes: 1

Related Questions