I am working on a mini-project for self-development on Bot Framework. Need some help here on my requirement. I want the Bot Conversation (Only bot NOT the user) to be fetched from database. I know how to send an activity and get the user response using static text as I have done below.
I have this code:
private static async Task<DialogTurnResult> NameConfirmStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken)
{
var promptOptions = new PromptOptions
{
Prompt = MessageFactory.Text($"Hello ! My name is XYZ and I am the Manager of ABC Dept.")
};
return await stepContext.PromptAsync(nameof(TextPrompt), promptOptions, cancellationToken);
}
private static async Task<DialogTurnResult> NameStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken)
{
stepContext.Values["intro"] = ((FoundChoice)stepContext.Result);
return await stepContext.PromptAsync(nameof(TextPrompt), new PromptOptions { Prompt = MessageFactory.Text("What is your name?") }, cancellationToken);
}
The above code is for the Bot's activity once User says something
However, I was wondering if there is a way we can read the Bot Turn Activity from database?
For example:
Bot: Hello!
Me: Hello
Bot: What is your name?
Me: XYZ
So what I want is the activity Texts of Bot like Hello, What is your name?, ... should come from database (preferably SQL). Is this possible?
I am using Bot Framework v4.0 Emulator for local testing.