This commit is contained in:
Nicolas ROBERT 2018-03-16 10:27:17 +01:00
Родитель 2870683814
Коммит 2fb64fb443
2 изменённых файлов: 8 добавлений и 28 удалений

Просмотреть файл

@ -76,7 +76,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Bot.Builder.Class
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Builder.Tests", "tests\Microsoft.Bot.Builder.Tests\Microsoft.Bot.Builder.Tests.csproj", "{7C7F5C89-C3A4-43B8-90D1-53F13C3A0510}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Bot.Schema.Tests", "tests\Microsoft.Bot.Schema.Tests\Microsoft.Bot.Schema.Tests.csproj", "{A4184239-F13F-4A09-B2D3-0B9532609248}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Schema.Tests", "tests\Microsoft.Bot.Schema.Tests\Microsoft.Bot.Schema.Tests.csproj", "{A4184239-F13F-4A09-B2D3-0B9532609248}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Samples.Ai.Luis", "samples\Microsoft.Bot.Samples.Ai.Luis\Microsoft.Bot.Samples.Ai.Luis.csproj", "{ED20DED8-C985-4C66-A58E-2A9CF4ECF6C3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -216,6 +218,10 @@ Global
{A4184239-F13F-4A09-B2D3-0B9532609248}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A4184239-F13F-4A09-B2D3-0B9532609248}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A4184239-F13F-4A09-B2D3-0B9532609248}.Release|Any CPU.Build.0 = Release|Any CPU
{ED20DED8-C985-4C66-A58E-2A9CF4ECF6C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ED20DED8-C985-4C66-A58E-2A9CF4ECF6C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ED20DED8-C985-4C66-A58E-2A9CF4ECF6C3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ED20DED8-C985-4C66-A58E-2A9CF4ECF6C3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -256,6 +262,7 @@ Global
{CDFEC7D6-847E-4C13-956B-0A960AE3EB60} = {2A46FEEF-4FD9-4DD5-8650-39C36CFDF2BB}
{7C7F5C89-C3A4-43B8-90D1-53F13C3A0510} = {AD743B78-D61F-4FBF-B620-FA83CE599A50}
{A4184239-F13F-4A09-B2D3-0B9532609248} = {AD743B78-D61F-4FBF-B620-FA83CE599A50}
{ED20DED8-C985-4C66-A58E-2A9CF4ECF6C3} = {3ADFB27A-95FA-4330-B211-1D66A29A17AB}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7173C9F3-A7F9-496E-9078-9156E35D6E16}

Просмотреть файл

@ -9,33 +9,6 @@ namespace AlarmBot
{
public static class TopicResponseHelpers
{
public static IMessageActivity ReplyWithSuggestions(BotContext context, string title, string message, string[] choices)
{
var reply = ReplyWithTitle(context, title, message);
reply.SuggestedActions = new SuggestedActions(
actions: choices.Select(choice =>
new CardAction(type: ActionTypes.ImBack,
title: choice,
value: choice.ToLower(),
displayText: choice.ToLower(),
text: choice.ToLower())).ToList());
return reply;
}
public static IMessageActivity ReplyWithTitle(IBotContext context, string title, string message)
{
StringBuilder sb = new StringBuilder();
if (title != null)
sb.AppendLine($"# {title}\n");
if (message != null)
sb.AppendLine(message);
return context.Request.CreateReply(sb.ToString());
}
/// <summary>
/// Create Yes/No card
/// </summary>