Skip to content

Commit

Permalink
Merge pull request #4054 from microsoft/hond/channeldata
Browse files Browse the repository at this point in the history
Allow the activity only with channelData property in sendActivity action
  • Loading branch information
Tom Laird-McConnell authored Jun 14, 2020
2 parents e899ee9 + e0d9919 commit 589bf05
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ public SendActivity(string text = null, [CallerFilePath] string callerPath = "",
|| !string.IsNullOrEmpty(activity.Text)
|| activity.Attachments?.Any() == true
|| !string.IsNullOrEmpty(activity.Speak)
|| activity.SuggestedActions != null)
|| activity.SuggestedActions != null
|| activity.ChannelData != null)
{
response = await dc.Context.SendActivityAsync(activity, cancellationToken).ConfigureAwait(false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,31 @@
"text": "static activity works"
}
}
},
{
"$kind": "Microsoft.SendActivity",
"activity": {
"$kind": "Microsoft.StaticActivityTemplate",
"activity": {
"type": "message",
"channelData": {
"attachment": {
"type": "template",
"payload": {
"template_type": "button",
"text": "What do you want to do next?",
"buttons": [
{
"type": "web_url",
"url": "https://www.messenger.com",
"title": "Visit Messenger"
}
]
}
}
}
}
}
}
]
}
Expand All @@ -58,6 +83,14 @@
{
"$kind": "Microsoft.Test.AssertReply",
"text": "static activity works"
},
{
"$kind": "Microsoft.Test.AssertReplyActivity",
"assertions": [
"type == 'message'",
"text == null",
"channelData != null"
]
}
]
}

0 comments on commit 589bf05

Please sign in to comment.