diff --git a/Bot.Builder.Community.Samples.sln b/Bot.Builder.Community.Samples.sln index 57ca6bf9..45c9985e 100644 --- a/Bot.Builder.Community.Samples.sln +++ b/Bot.Builder.Community.Samples.sln @@ -26,16 +26,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Google Adapter Sample", "sa EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Zoom Adapter Sample", "samples\Zoom Adapter Sample\Zoom Adapter Sample.csproj", "{D5F5BFB0-CDEC-4980-9EBB-864724B6B2B6}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Infobip Adapter Sample", "samples\Infobip Adapter Sample\Infobip Adapter Sample.csproj", "{BC01A8C4-3FEB-46E8-AE39-D71F5CB7602F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7927A7EE-C327-4403-A5F4-B5E2C0BF4D47}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7927A7EE-C327-4403-A5F4-B5E2C0BF4D47}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7927A7EE-C327-4403-A5F4-B5E2C0BF4D47}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7927A7EE-C327-4403-A5F4-B5E2C0BF4D47}.Release|Any CPU.Build.0 = Release|Any CPU {10BEDE11-C9DE-4B67-9467-4E48272229C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {10BEDE11-C9DE-4B67-9467-4E48272229C6}.Debug|Any CPU.Build.0 = Debug|Any CPU {10BEDE11-C9DE-4B67-9467-4E48272229C6}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -60,14 +58,6 @@ Global {55F863F1-9EC8-420C-9099-BD8378D72F18}.Debug|Any CPU.Build.0 = Debug|Any CPU {55F863F1-9EC8-420C-9099-BD8378D72F18}.Release|Any CPU.ActiveCfg = Release|Any CPU {55F863F1-9EC8-420C-9099-BD8378D72F18}.Release|Any CPU.Build.0 = Release|Any CPU - {37ED6FBD-12B5-40CF-837F-6F75ACC65484}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {37ED6FBD-12B5-40CF-837F-6F75ACC65484}.Debug|Any CPU.Build.0 = Debug|Any CPU - {37ED6FBD-12B5-40CF-837F-6F75ACC65484}.Release|Any CPU.ActiveCfg = Release|Any CPU - {37ED6FBD-12B5-40CF-837F-6F75ACC65484}.Release|Any CPU.Build.0 = Release|Any CPU - {89A6903F-2911-4A27-B178-EA28D697D46B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {89A6903F-2911-4A27-B178-EA28D697D46B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {89A6903F-2911-4A27-B178-EA28D697D46B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {89A6903F-2911-4A27-B178-EA28D697D46B}.Release|Any CPU.Build.0 = Release|Any CPU {D1C3490D-477A-4D79-A41C-4D15CA9DC183}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D1C3490D-477A-4D79-A41C-4D15CA9DC183}.Debug|Any CPU.Build.0 = Debug|Any CPU {D1C3490D-477A-4D79-A41C-4D15CA9DC183}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -84,10 +74,18 @@ Global {53BCE929-C57D-4AF9-91C9-FCA5C7E2CE41}.Debug|Any CPU.Build.0 = Debug|Any CPU {53BCE929-C57D-4AF9-91C9-FCA5C7E2CE41}.Release|Any CPU.ActiveCfg = Release|Any CPU {53BCE929-C57D-4AF9-91C9-FCA5C7E2CE41}.Release|Any CPU.Build.0 = Release|Any CPU + {89A6903F-2911-4A27-B178-EA28D697D46B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {89A6903F-2911-4A27-B178-EA28D697D46B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {89A6903F-2911-4A27-B178-EA28D697D46B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {89A6903F-2911-4A27-B178-EA28D697D46B}.Release|Any CPU.Build.0 = Release|Any CPU {D5F5BFB0-CDEC-4980-9EBB-864724B6B2B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D5F5BFB0-CDEC-4980-9EBB-864724B6B2B6}.Debug|Any CPU.Build.0 = Debug|Any CPU {D5F5BFB0-CDEC-4980-9EBB-864724B6B2B6}.Release|Any CPU.ActiveCfg = Release|Any CPU {D5F5BFB0-CDEC-4980-9EBB-864724B6B2B6}.Release|Any CPU.Build.0 = Release|Any CPU + {BC01A8C4-3FEB-46E8-AE39-D71F5CB7602F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BC01A8C4-3FEB-46E8-AE39-D71F5CB7602F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BC01A8C4-3FEB-46E8-AE39-D71F5CB7602F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BC01A8C4-3FEB-46E8-AE39-D71F5CB7602F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/README.md b/README.md index d8e58ba3..1836d05e 100644 --- a/README.md +++ b/README.md @@ -34,8 +34,8 @@ The following adapters can be used to expose your bot on additional channels not | [Google Adapter](libraries/Bot.Builder.Community.Adapters.Google) | An adapter to allow for Google Actions to be built using the Bot Builder SDK. Includes broad support for Google Actions capabilities, including Cards and suggestion chips | [Sample](https://github.com/BotBuilderCommunity/botbuilder-community-dotnet/tree/master/samples/Google%20Adapter%20Sample) | [![NuGet version](https://img.shields.io/badge/NuGet-blue.svg)](https://www.nuget.org/packages/Bot.Builder.Community.Adapters.Google/) | | [Twitter Adapter](libraries/Bot.Builder.Community.Adapters.Twitter) | An adapter that integrates Twitter Direct Messages with the Bot Builder. The adapter sets up the required webhooks and responds to CRC requests. The webhooks code is based on the work by Tweety with modifications to support the Premium tier of the Account Activity API. | [Sample](https://github.com/BotBuilderCommunity/botbuilder-community-dotnet/tree/master/samples/Twitter%20Adapter%20Sample) | [![NuGet version](https://img.shields.io/badge/NuGet-blue.svg)](https://www.nuget.org/packages/Bot.Builder.Community.Adapters.Twitter/) | | [RingCentral Adapter](libraries/Bot.Builder.Community.Adapters.RingCentral) | An adapter that integrates the RingCentral Platform API with the Bot Builder. The adapter sets up the required webhooks and endpoints to RingCentral requests. Supporting features such as human handoff, activity publishing and WhatsApp support. | [Sample](https://github.com/BotBuilderCommunity/botbuilder-community-dotnet/tree/master/samples/RingCentral%20Adapter%20Sample) | [![NuGet version](https://img.shields.io/badge/NuGet-blue.svg)](https://www.nuget.org/packages/Bot.Builder.Community.Adapters.RingCentral/) | -| [Zoom Adapter](libraries/Bot.Builder.Community.Adapters.Zoom) | An adapter that accepts and hanldes Zoom app requests. Specifically developed to handle Zoom chatbot app requests and allow for the sending of messages using Zoom Message Templates. The adapter will also receieve any event subscribed to via Zoom, even those not chatbot related. | [Sample](https://github.com/BotBuilderCommunity/botbuilder-community-dotnet/tree/develop/samples/Zoom%20Adapter%20Sample) | [![NuGet version](https://img.shields.io/badge/NuGet-blue.svg)](https://www.nuget.org/packages/Bot.Builder.Community.Adapters.Zoom/) | -| [InfoBip WhatsApp Adapter](libraries/Bot.Builder.Community.Adapters.InfoBip) | An adapter that accepts and hanldes WhatsApp app requests via InfoBip, including support for various message and template types. | | [![NuGet version](https://img.shields.io/badge/NuGet-blue.svg)](https://github.com/BotBuilderCommunity/botbuilder-community-dotnet/tree/develop/libraries/Bot.Builder.Community.Adapters.Infobip/) | +| [Zoom Adapter](libraries/Bot.Builder.Community.Adapters.Zoom) | An adapter that accepts and handles Zoom app requests. Specifically developed to handle Zoom chatbot app requests and allow for the sending of messages using Zoom Message Templates. The adapter will also receieve any event subscribed to via Zoom, even those not chatbot related. | [Sample](https://github.com/BotBuilderCommunity/botbuilder-community-dotnet/tree/develop/samples/Zoom%20Adapter%20Sample) | [![NuGet version](https://img.shields.io/badge/NuGet-blue.svg)](https://www.nuget.org/packages/Bot.Builder.Community.Adapters.Zoom/) | +| [Infobip WhatsApp Adapter](libraries/Bot.Builder.Community.Adapters.Infobip) | An adapter that accepts and hanldes WhatsApp app requests via Infobip, including support for various message and template types. | [Sample](https://github.com/BotBuilderCommunity/botbuilder-community-dotnet/tree/develop/samples/Infobip%20Adapter%20Sample) | [![NuGet version](https://img.shields.io/badge/NuGet-blue.svg)](https://github.com/BotBuilderCommunity/botbuilder-community-dotnet/tree/develop/libraries/Bot.Builder.Community.Adapters.Infobip/) | ## Dialogs and Prompts diff --git a/libraries/Bot.Builder.Community.Adapters.Alexa.Core/Bot.Builder.Community.Adapters.Alexa.Core.csproj b/libraries/Bot.Builder.Community.Adapters.Alexa.Core/Bot.Builder.Community.Adapters.Alexa.Core.csproj index 08b6f0e3..78dc7305 100644 --- a/libraries/Bot.Builder.Community.Adapters.Alexa.Core/Bot.Builder.Community.Adapters.Alexa.Core.csproj +++ b/libraries/Bot.Builder.Community.Adapters.Alexa.Core/Bot.Builder.Community.Adapters.Alexa.Core.csproj @@ -19,11 +19,11 @@ - + - - + + diff --git a/libraries/Bot.Builder.Community.Adapters.Alexa/Bot.Builder.Community.Adapters.Alexa.csproj b/libraries/Bot.Builder.Community.Adapters.Alexa/Bot.Builder.Community.Adapters.Alexa.csproj index c1b7eaf4..bb69a6bd 100644 --- a/libraries/Bot.Builder.Community.Adapters.Alexa/Bot.Builder.Community.Adapters.Alexa.csproj +++ b/libraries/Bot.Builder.Community.Adapters.Alexa/Bot.Builder.Community.Adapters.Alexa.csproj @@ -20,10 +20,7 @@ - - - - + diff --git a/libraries/Bot.Builder.Community.Adapters.Google.Core/Bot.Builder.Community.Adapters.Google.Core.csproj b/libraries/Bot.Builder.Community.Adapters.Google.Core/Bot.Builder.Community.Adapters.Google.Core.csproj index 43bf3360..6b2ddb56 100644 --- a/libraries/Bot.Builder.Community.Adapters.Google.Core/Bot.Builder.Community.Adapters.Google.Core.csproj +++ b/libraries/Bot.Builder.Community.Adapters.Google.Core/Bot.Builder.Community.Adapters.Google.Core.csproj @@ -7,7 +7,7 @@ - + diff --git a/libraries/Bot.Builder.Community.Adapters.Google.Core/ConversationRequestMapper.cs b/libraries/Bot.Builder.Community.Adapters.Google.Core/ConversationRequestMapper.cs index 9de68e41..5e72f3f4 100644 --- a/libraries/Bot.Builder.Community.Adapters.Google.Core/ConversationRequestMapper.cs +++ b/libraries/Bot.Builder.Community.Adapters.Google.Core/ConversationRequestMapper.cs @@ -160,7 +160,8 @@ public ConversationWebhookResponse ActivityToResponse(Activity activity, Convers } } }; - response.ExpectedInputs.First().InputPrompt.RichInitialPrompt.Suggestions = ConvertSuggestedActionsToSuggestionChips(activity)?.ToArray(); + response.ExpectedInputs.First().InputPrompt.RichInitialPrompt.Suggestions = ConvertIMAndMessageBackSuggestedActionsToSuggestionChips(activity)?.ToArray(); + response.ExpectedInputs.First().InputPrompt.RichInitialPrompt.LinkOutSuggestion = GetLinkOutSuggestionFromActivity(activity); break; } diff --git a/libraries/Bot.Builder.Community.Adapters.Google.Core/DialogFlowRequestMapper.cs b/libraries/Bot.Builder.Community.Adapters.Google.Core/DialogFlowRequestMapper.cs index 44cc6c0f..3c971389 100644 --- a/libraries/Bot.Builder.Community.Adapters.Google.Core/DialogFlowRequestMapper.cs +++ b/libraries/Bot.Builder.Community.Adapters.Google.Core/DialogFlowRequestMapper.cs @@ -125,7 +125,8 @@ public DialogFlowResponse ActivityToResponse(Activity activity, DialogFlowReques response.Payload.Google.RichResponse = new RichResponse() { - Items = responseItems.ToArray() + Items = responseItems.ToArray(), + LinkOutSuggestion = GetLinkOutSuggestionFromActivity(activity) }; // ensure InputHint is set as required for response @@ -144,7 +145,7 @@ public DialogFlowResponse ActivityToResponse(Activity activity, DialogFlowReques case InputHints.ExpectingInput: response.Payload.Google.ExpectUserResponse = true; - var suggestionChips = ConvertSuggestedActionsToSuggestionChips(activity); + var suggestionChips = ConvertIMAndMessageBackSuggestedActionsToSuggestionChips(activity); if (suggestionChips.Any()) { response.Payload.Google.RichResponse.Suggestions = suggestionChips.ToArray(); diff --git a/libraries/Bot.Builder.Community.Adapters.Google.Core/GoogleRequestMapperBase.cs b/libraries/Bot.Builder.Community.Adapters.Google.Core/GoogleRequestMapperBase.cs index 1bceeed0..da4ad9f2 100644 --- a/libraries/Bot.Builder.Community.Adapters.Google.Core/GoogleRequestMapperBase.cs +++ b/libraries/Bot.Builder.Community.Adapters.Google.Core/GoogleRequestMapperBase.cs @@ -202,7 +202,7 @@ public string StripInvocation(string query, string invocationName) return query; } - public static List ConvertSuggestedActionsToSuggestionChips(Activity activity) + public static List ConvertIMAndMessageBackSuggestedActionsToSuggestionChips(Activity activity) { var suggestions = new List(); @@ -210,11 +210,34 @@ public static List ConvertSuggestedActionsToSuggestionChips(Activity { foreach (var suggestion in activity.SuggestedActions.Actions) { - suggestions.Add(new Suggestion { Title = suggestion.Title }); + if (suggestion.Type == ActionTypes.ImBack || suggestion.Type == ActionTypes.MessageBack) + { + suggestions.Add(new Suggestion { Title = suggestion.Title }); + } } } return suggestions; } + + public static LinkOutSuggestion GetLinkOutSuggestionFromActivity(Activity activity) + { + var openUrlSuggestedAction = activity.SuggestedActions?.Actions?.Where(a => a.Type == ActionTypes.OpenUrl).FirstOrDefault(); + + if(openUrlSuggestedAction == null) + { + return null; + } + + return new LinkOutSuggestion() + { + DestinationName = openUrlSuggestedAction.Title, + OpenUrlAction = new OpenUrlAction() + { + Url = openUrlSuggestedAction.Value?.ToString(), + UrlTypeHint = UrlTypeHint.URL_TYPE_HINT_UNSPECIFIED + } + }; + } } } diff --git a/libraries/Bot.Builder.Community.Adapters.Google.Core/Helpers/GoogleCardFactory.cs b/libraries/Bot.Builder.Community.Adapters.Google.Core/Helpers/GoogleCardFactory.cs index 47a3527a..550a6eb6 100644 --- a/libraries/Bot.Builder.Community.Adapters.Google.Core/Helpers/GoogleCardFactory.cs +++ b/libraries/Bot.Builder.Community.Adapters.Google.Core/Helpers/GoogleCardFactory.cs @@ -8,7 +8,7 @@ namespace Bot.Builder.Community.Adapters.Google.Core.Helpers { public static class GoogleCardFactory { - public static BasicCard CreateBasicCard(string title, string subtitle, string formattedText) + public static BasicCard CreateBasicCard(string title, string subtitle, string formattedText, List