Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint Node using-cards #1421

Closed
wants to merge 278 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
278 commits
Select commit Hold shift + click to select a range
1f75824
Merge pull request #1286 from Microsoft/johtaylo/cleanup-core-bot
johnataylor Mar 5, 2019
ac6bd5c
appsettings
johnataylor Mar 5, 2019
bd37e1e
Merge pull request #1287 from Microsoft/johtaylo/core-bot-config
johnataylor Mar 5, 2019
20745e0
added ConversationState.Delete to OnTurnError
johnataylor Mar 5, 2019
a28fe70
Merge pull request #1289 from Microsoft/johtaylo/core-bot-state-delete
johnataylor Mar 5, 2019
b871b9a
added Choice prompt
johnataylor Mar 6, 2019
747ee08
Merge pull request #1290 from Microsoft/johtaylo/add-choice-to-multi
johnataylor Mar 6, 2019
451846e
delete nlp with luis
johnataylor Mar 6, 2019
ccc4c0e
Merge pull request #1291 from Microsoft/johtaylo/delete-nlp-with-luis
johnataylor Mar 6, 2019
e250fe7
bug in datetime
johnataylor Mar 6, 2019
8cd5dc2
Merge pull request #1292 from Microsoft/johtaylo/minor-bug-out-of-path
johnataylor Mar 6, 2019
3e520d7
incorporate feedback
johnataylor Mar 6, 2019
4e9964b
Merge pull request #1294 from Microsoft/johtaylo/core-bot-feedback
johnataylor Mar 6, 2019
d6d3199
flatten config
johnataylor Mar 6, 2019
0fde2fa
Merge pull request #1295 from Microsoft/johtaylo/core-config
johnataylor Mar 6, 2019
bf79aa9
updated qna bot
johnataylor Mar 6, 2019
97a140d
Merge pull request #1297 from Microsoft/johtaylo/qna-update
johnataylor Mar 7, 2019
c281ec7
appsettings update
johnataylor Mar 7, 2019
163ce3a
Merge pull request #1298 from Microsoft/johtaylo/flatten-config
johnataylor Mar 7, 2019
c1c3b93
Ignore Nuget.Config files
sgellock Mar 7, 2019
dbd4d23
.NET Templates: Update CoreBot
sgellock Mar 7, 2019
ce46c0e
.NET Templates: Update EchoBot
sgellock Mar 7, 2019
66859de
Fixes 853 - Intro card is using incorrect "isSubtle" property with "y…
sgellock Mar 7, 2019
0adf51d
minor clean up in Startup and better error handling
johnataylor Mar 7, 2019
44d0964
Merge pull request #1302 from Microsoft/johtaylo/error-delete-state
johnataylor Mar 7, 2019
aca38bf
.NET Templates: cleanup CoreBot and EchoBot
sgellock Mar 7, 2019
c68d89a
Merge branch 'samples-work-in-progress' of https://github.com/Microso…
sgellock Mar 7, 2019
fcb1e3c
.NET Templates: First pass at new EmptyBot
sgellock Mar 7, 2019
0de8e8a
.NET Templates: bump EchoBot version
sgellock Mar 7, 2019
f0246de
Create readme.md
Kaiqb Mar 7, 2019
ee1ea98
Add files via upload
Kaiqb Mar 7, 2019
9720564
Delete readme.md
Kaiqb Mar 7, 2019
8ea3338
Merge pull request #1307 from Microsoft/cognitive-models
johnataylor Mar 7, 2019
bb2497d
simplify proactive sample
johnataylor Mar 8, 2019
9a19c59
Merge pull request #1309 from Microsoft/johtaylo/proactive
johnataylor Mar 8, 2019
d4512b1
Merge branch 'samples-work-in-progress' of https://github.com/Microso…
sgellock Mar 8, 2019
9d83955
Updated Welcome User Bot
Kaiqb Mar 12, 2019
136d9f6
remove .bot file from Node.js 02.a.echobot (#1268)
stevengum Mar 12, 2019
fcfbbea
fix Node.js EchoBot myBot.onTurn bug (#1316)
stevengum Mar 12, 2019
86846f5
fixed auth bot - minor changes on core
johnataylor Mar 12, 2019
3e8f43b
Merge pull request #1317 from Microsoft/johtaylo/bot-auth-revisited
johnataylor Mar 12, 2019
d4703f3
Merge branch 'samples-work-in-progress' of https://github.com/Microso…
sgellock Mar 12, 2019
618f399
drop Accessors class
johnataylor Mar 12, 2019
50eb619
Merge pull request #1314 from Microsoft/kaiqb-welcomebot
johnataylor Mar 12, 2019
207fef3
.NET Templates: Update CoreBot with latest changes, EchoBot default.htm
sgellock Mar 12, 2019
78ac9a1
Merge branch 'samples-work-in-progress' of https://github.com/Microso…
sgellock Mar 12, 2019
f9c4f88
consistent DialogBot
johnataylor Mar 12, 2019
af7e639
Merge pull request #1318 from Microsoft/johtaylo/random-cleanup
johnataylor Mar 12, 2019
731eeb6
Updated Adaptive Cards sample
Kaiqb Mar 12, 2019
314f108
Merge pull request #1319 from Microsoft/kaiqb/adaptive-card
johnataylor Mar 12, 2019
f3fef2a
Rewrite Node.js BasicBot to CoreBot (#1320)
stevengum Mar 13, 2019
884048e
Removed extra file, fixed SendActivity bug.
Kaiqb Mar 13, 2019
7271753
Merge pull request #1324 from Microsoft/kaiqb/adaptiveCards
Kaiqb Mar 13, 2019
3450ae3
cards on mvc and no bot file
johnataylor Mar 13, 2019
2178ad9
Merge pull request #1325 from Microsoft/johtaylo/cardsbot
johnataylor Mar 13, 2019
d8cb111
.NET Templates: Update EmptyBot to use new 4.3 patterns
sgellock Mar 13, 2019
2bbe832
.NET Templates: update to using 4.3.2 of bot framework
sgellock Mar 13, 2019
533e8f7
Updated SuggestedActions, AdaptiveCards, and Welcome User sample
Kaiqb Mar 13, 2019
bf99a66
Merge pull request #1326 from Microsoft/kaiqb/suggestedActions
Kaiqb Mar 13, 2019
3976317
Fix up various default.html file issues
sgellock Mar 14, 2019
051d837
reorder master solution file
sgellock Mar 14, 2019
db5cdc3
[JS Sample 15] Fix for image attachments (#1323) (#1329)
stevengum Mar 14, 2019
b19ec7b
Updated Handling Attachments Sample
Kaiqb Mar 14, 2019
ebbedd2
Merge pull request #1330 from Microsoft/kaiqb/handling-attachments
Kaiqb Mar 14, 2019
91bbf2c
msgraph work in progress
johnataylor Mar 14, 2019
2aa6f7a
Merge pull request #1333 from Microsoft/johtaylo/msgraph
johnataylor Mar 14, 2019
4e22db3
fix exception on msgraph sample
johnataylor Mar 14, 2019
e443d83
Merge pull request #1334 from Microsoft/johtaylo/msgraph-fixes
johnataylor Mar 14, 2019
8bae34c
Fix bugs in CoreBot javascript sample
sgellock Mar 15, 2019
b0a8a76
Merge branch 'samples-work-in-progress' of https://github.com/Microso…
sgellock Mar 15, 2019
13da0a2
skip step when no LUIS
johnataylor Mar 15, 2019
30349b3
Merge pull request #1336 from Microsoft/johtaylo/core-bot-skip
johnataylor Mar 15, 2019
a60a77f
Update README.md and add PREREQUISITES.md
sgellock Mar 16, 2019
90d6df8
.NET Templates: Cleanup and consistency items
sgellock Mar 16, 2019
6a7292f
Combined samples from BotFramework-Samples branch
Kaiqb Mar 19, 2019
159c1ca
refactoring in complex bot
johnataylor Mar 19, 2019
9f222c9
Merge pull request #1340 from Microsoft/kaiqb/combined-samples
johnataylor Mar 19, 2019
bc812c5
update csproj files
johnataylor Mar 19, 2019
f9a0033
Merge pull request #1343 from Microsoft/johtaylo/cleanup-warnings
johnataylor Mar 19, 2019
7695212
revised TypeScript Basic Bot, Echo Bot (#1347)
stevengum Mar 21, 2019
7daa6c9
remove old porjects
johnataylor Mar 22, 2019
a7034cc
Merge pull request #1351 from Microsoft/johtaylo/webapi-sample-refresh
Kaiqb Mar 22, 2019
9f9b1f0
Update VSIX Echo, Core, and Empty templates
sgellock Mar 23, 2019
234627f
bug fixes for CoreBot
sgellock Mar 23, 2019
dfb5af2
add new zip file location to gitignore
sgellock Mar 23, 2019
9d1aefc
Remove JS samples
Kaiqb Mar 23, 2019
ae67552
Merge pull request #1352 from Microsoft/kaiqb/js-cleanup
Kaiqb Mar 23, 2019
6fb8fc7
put echobot back
johnataylor Mar 25, 2019
ef5faa9
Merge pull request #1355 from Microsoft/johtaylo/echo-back
johnataylor Mar 25, 2019
7ef8099
VSIX bug fixes
sgellock Mar 26, 2019
f63b775
Merge branch 'samples-work-in-progress' of https://github.com/Microso…
sgellock Mar 26, 2019
f82f8a3
Changed references to Microsoft.AspNetCore.All to Microsoft.AspNetCor…
gabog Mar 26, 2019
74ade3f
Consolidated and updated BF references from 4.3.1 to 4.3.2
gabog Mar 26, 2019
d5603f3
yeoman generator: update echo, core, and empty for typescript
sgellock Mar 27, 2019
6cd29ca
rename basic-bot to core-bot
sgellock Mar 27, 2019
7876f30
remove dead typescript samples
sgellock Mar 27, 2019
78bcfef
update master README.md
sgellock Mar 27, 2019
c9763cf
rename basic bot to core bot
johnataylor Mar 27, 2019
d68b462
Merge pull request #1359 from Microsoft/johtaylo/rename-core
johnataylor Mar 27, 2019
bf03544
Update README.md
Kaiqb Mar 27, 2019
df97167
Update README.md
Kaiqb Mar 27, 2019
75e6f77
Update README.md
Kaiqb Mar 27, 2019
caab5ba
Update README.md
Kaiqb Mar 27, 2019
fe20d28
Update README.md
Kaiqb Mar 27, 2019
4b5a06a
Update README.md
Kaiqb Mar 27, 2019
1a1a8ab
Yeoman core bot for javascript
sgellock Mar 27, 2019
3a64aa4
Merge branch 'samples-work-in-progress' of https://github.com/Microso…
sgellock Mar 27, 2019
ef82cd3
Update README.md
Kaiqb Mar 27, 2019
ebd0491
Update README.md
Kaiqb Mar 27, 2019
9938953
Update README.md
Kaiqb Mar 27, 2019
f4da12d
Merge pull request #1360 from Microsoft/kaiqb/readme
Kaiqb Mar 27, 2019
e74d035
Yeoman: update echo bot
sgellock Mar 27, 2019
2d28737
Merge branch 'samples-work-in-progress' of https://github.com/Microso…
sgellock Mar 27, 2019
54b7349
yeoman: update empty bot
sgellock Mar 28, 2019
7a7127c
add ARM template, use ActivityHandler in Node.js welcome-users (#1358)
stevengum Mar 28, 2019
e5c37d1
generators: add deploymentTemplates to all generators
sgellock Mar 29, 2019
183c754
clean up bf-emulator sections in Node.js READMEs
stevengum Mar 29, 2019
bd5e9fe
Updated Program.cs code to align with code generated by VSIX.
gabog Mar 29, 2019
5011d1c
add deploymentTemplates to .netcore samples 03 and 13
stevengum Mar 29, 2019
b7cb385
add deploymentTemplates folder to Node.js sample 13
stevengum Mar 29, 2019
634022e
VSIX update icons
sgellock Mar 31, 2019
824784f
.NET Templates and Yeoman: bump version number
sgellock Mar 31, 2019
7e1cc33
Merge branch 'samples-work-in-progress' of https://github.com/Microso…
sgellock Mar 31, 2019
363f6fd
VSIX: update icons
sgellock Apr 1, 2019
21da5e7
Merge branch 'samples-work-in-progress' of https://github.com/Microso…
sgellock Apr 1, 2019
8425245
Reverted parametrization to parameterization
gabog Apr 1, 2019
9644517
Merge pull request #1363 from Microsoft/gabog/SampleUpdatesForNewMVC
gabog Apr 1, 2019
05b0751
VSIX ASP.net idomatic cleanup
sgellock Apr 1, 2019
a1b8d78
VSIX idomatic asp.net bug fixes
sgellock Apr 1, 2019
15f118f
Merge branch 'samples-work-in-progress' of https://github.com/Microso…
sgellock Apr 1, 2019
b0cc5f2
.NET Templates: address idiomatic namespace changes
sgellock Apr 2, 2019
e123fcd
VSIX: update README.md
sgellock Apr 2, 2019
f499722
add LUIS CLI READMEs to .netcore & Node.js CoreBots
stevengum Apr 2, 2019
75cd06b
VSIX: more idomatic C# changes
sgellock Apr 2, 2019
35e86b6
Merge branch 'samples-work-in-progress' of https://github.com/Microso…
sgellock Apr 2, 2019
e2e1f82
.NET Templates: update with idiomatic changes
sgellock Apr 2, 2019
f5e0985
dotnet core sample: update core-bot
sgellock Apr 2, 2019
75d4c09
VSIX README.md tweaks
sgellock Apr 2, 2019
fdbfa45
dotnet core 12.core-bot sample, update namespaces
sgellock Apr 2, 2019
591f9ce
.NET Templates: update nuget icon
sgellock Apr 2, 2019
ab27e37
update all default.htm files for dotnet core samples
sgellock Apr 3, 2019
92c6c7d
Changed UserProfileDialog to use nameof() for the dialogId.
gabog Apr 3, 2019
704897b
Merge pull request #1377 from Microsoft/gabog/ChangeRootByNameOf
gabog Apr 3, 2019
71f5b82
Fixes UserProfileDialog.AgePromptValidatorAsync()
gabog Apr 3, 2019
ed66db5
Merge pull request #1378 from Microsoft/gabog/FixAgeValidation
gabog Apr 3, 2019
2316f09
Fix grammatical errors in user displayed messages
sgellock Apr 3, 2019
b3417ad
Merge branch 'samples-work-in-progress' of https://github.com/Microso…
sgellock Apr 3, 2019
1e26224
add updated READMEs and ARM templates
stevengum Apr 4, 2019
8268516
lint TS Corebot sample, remove BlobStorage code in CoreBots
stevengum Apr 4, 2019
ed34fc9
rewrite Node.js sample 19.custom-dialogs for 4.3.x
stevengum Apr 4, 2019
511acac
remove unused --location from az webapp deployment
stevengum Apr 4, 2019
d0848ab
cleanup Node.js sample 19 RootDialog
stevengum Apr 4, 2019
1023d9d
cleanup on Node.js 18 auth sample
stevengum Apr 5, 2019
60f3df2
rewrite Node.js suggested-actions, cleanup custom-dialogs
stevengum Apr 5, 2019
0a4c201
rewrite Node.js adaptive-cards sample
stevengum Apr 5, 2019
8434d4a
remove botfiles from Node.js adaptive-cards, suggested-actions samples
stevengum Apr 5, 2019
30110d2
rewrite Node.js attachments bot
stevengum Apr 5, 2019
17801dc
update Node.js welcome-users
stevengum Apr 5, 2019
ca0fdd8
fix Node.js AuthBot to call next() in activity handlers
stevengum Apr 5, 2019
3ae4f87
cleanup Node.js CoreBot README
stevengum Apr 5, 2019
0b33893
update relative link
stevengum Apr 5, 2019
b00d655
reach parity for Node.js welcome bot with C#
stevengum Apr 5, 2019
e8dc074
Update README.md
Kaiqb Apr 5, 2019
bdaa6bc
VSIX: update DeploymentTempaltes folder
sgellock Apr 6, 2019
ff7b9ad
.NET Templates: update Echo, Core, and Empty to use latest ARM templ…
sgellock Apr 6, 2019
428a551
Yeoman generator: update Echo Core, and Empty to use latest ARM temp…
sgellock Apr 6, 2019
4e1df6e
Fixes #1158 - update SPEC.md
sgellock Apr 6, 2019
b5a20fa
VSIX: update individual templates with new icons
sgellock Apr 6, 2019
8474fdf
add activityHandler fixes to Node.js Corebot
stevengum Apr 8, 2019
e15032d
fix ActivityHandler in Node.js samples
stevengum Apr 8, 2019
5682b6f
update Node.js echo bot sample
stevengum Apr 8, 2019
13926f5
Update MultiLingualBot to use latest sample design patterns
Apr 9, 2019
aecc84c
Remove the dotnet Conversation History sample
Apr 9, 2019
22692ac
Update Web Chat Adapter sample (#1386)
Apr 9, 2019
0764d22
Address feedback
Apr 9, 2019
bb492b7
Add cancellationToken to SendActivityAsync
Apr 9, 2019
41d90d0
Merge pull request #1387 from Microsoft/eric/MultiLingualBotUpdates
gabog Apr 9, 2019
d8d0a4f
Merge pull request #1388 from Microsoft/eric/removeConversationHistor…
gabog Apr 9, 2019
c352ede
remove alwaysBuildOnDeploy from ARM templates, rev ARM READMEs
stevengum Apr 9, 2019
f9fb9fc
Merge branch 'samples-work-in-progress' of https://github.com/microso…
stevengum Apr 9, 2019
0cc96a3
additional cleanup on ARM READMEs and tempaltes
stevengum Apr 9, 2019
2ccf162
Fix issues with proactive bot sample
Apr 9, 2019
174e4c0
add updated Node.js prompt-for-user-input sample
stevengum Apr 10, 2019
0316d36
add updated README for Node.js prompt-for-user-input
stevengum Apr 10, 2019
a04aec7
add Node.js state-management sample
stevengum Apr 10, 2019
749a770
initial commit of Node.js complex-dialog sample
stevengum Apr 10, 2019
809326e
add updated Node.js complex-dialog sample
stevengum Apr 10, 2019
4c344c6
update docstring in Node.js corebot for MainDialog.run
stevengum Apr 10, 2019
c09c199
remove TypeScript QnAMaker sample
stevengum Apr 10, 2019
f8e3501
remove qna-with-appinsights samples
stevengum Apr 10, 2019
2af2336
Yeoman: update pacakge.json commands & fix activity handler bugs
sgellock Apr 10, 2019
be7e8a8
Node.js samples: update README.md, remove depricated codee
sgellock Apr 10, 2019
2540d35
Merge branch 'samples-work-in-progress' of https://github.com/Microso…
sgellock Apr 10, 2019
1ddcdeb
Update all generators to use latest version of ARM templates
sgellock Apr 10, 2019
0bfaa88
.NET Templates: add template version tag in source code
sgellock Apr 10, 2019
f0a30f3
VSIX: Write version information in generated code
sgellock Apr 11, 2019
a605598
[JS][16.proactive-messages] Update for 4.3.4
tdurnford Apr 11, 2019
9568d1a
remove ARM template READMEs
stevengum Apr 11, 2019
360c2fc
Merge branch 'samples-work-in-progress' of https://github.com/microso…
stevengum Apr 11, 2019
c90e7ec
added activity logger
tdurnford Apr 11, 2019
a6d893e
cleanup in C# Multi-turn-prompt
stevengum Apr 11, 2019
b02def9
updated Node.js multi-turn-prompt sample
stevengum Apr 11, 2019
bb05101
Update README.md’s and package.json files
sgellock Apr 11, 2019
1fc253e
Merge branch 'samples-work-in-progress' of https://github.com/Microso…
sgellock Apr 11, 2019
dd4440d
Initial improvements
Apr 12, 2019
44a8d7f
Remove unnecessary botframework-config dependency
Apr 12, 2019
0d9403c
brought node proactive message sample up to parity with csharp
tdurnford Apr 12, 2019
b63d52a
updated comments in index file.
tdurnford Apr 12, 2019
e23ed3d
Fix C# sample
Apr 12, 2019
1dbded8
Fix receipt card and switch statement in C# sample
Apr 12, 2019
cc6341e
Adjust Node sample 6 to match C#
Apr 12, 2019
909d73f
Add deployment templates for core deployment scenarios
sgellock Apr 15, 2019
a1e0e99
Updated comments
tdurnford Apr 15, 2019
fa57d4e
Merge branch 'samples-work-in-progress' into samples-work-in-progress
tdurnford Apr 15, 2019
141f238
Fix missing next() calls in all versions of Echo, Core, and Empty for…
sgellock Apr 15, 2019
a0b2d76
test noclean cli option
sgellock Apr 15, 2019
61787f3
Generators: bump version number
sgellock Apr 15, 2019
26a4427
added welcome message
tdurnford Apr 16, 2019
344ab96
modified readme to reflect changes
tdurnford Apr 16, 2019
9b50ab2
add .net core echo bot, update master readme
sgellock Apr 16, 2019
54283d9
Add EchoBot to master soluton file
sgellock Apr 16, 2019
74d79e0
Fix formatting bug in master readme table
sgellock Apr 16, 2019
5a8f857
Add description of NotifyController to ReadMe. Remove user names and…
Apr 16, 2019
2d68766
add closing h1
Apr 16, 2019
703b939
added message to landing page
tdurnford Apr 16, 2019
a927f13
fix lint cmd line in package.json
johnataylor Apr 16, 2019
8b7b85d
Merge pull request #1409 from Microsoft/johtaylo/fix-lint-cmd-line
johnataylor Apr 16, 2019
bd27635
fix lint cmd
johnataylor Apr 16, 2019
ca3d98f
Merge pull request #1410 from Microsoft/johtaylo/fix-lint-in-17
johnataylor Apr 16, 2019
a86724e
Updated 17.multilingual Nodejs sample to match C# version
Apr 16, 2019
f81b230
Merge pull request #1393 from Microsoft/eric/proactiveBotUpdates
Kaiqb Apr 16, 2019
1849b72
added onMessage echo
tdurnford Apr 16, 2019
c0b2a08
few updates
johnataylor Apr 16, 2019
8401951
Merge pull request #1406 from Microsoft/stkanb/17-multilingual-update
johnataylor Apr 16, 2019
9858481
update package.json lint command syntax
sgellock Apr 17, 2019
10bfd69
update typescript package.json script commands
sgellock Apr 17, 2019
fa85249
updated readme
tdurnford Apr 17, 2019
b6b5e9a
Make requested changes to C# card sample 6 for PR #1400
Apr 17, 2019
65ff90f
Make requested changes to Node card sample 6 for PR #1400
Apr 17, 2019
87ce7e8
Undo SendActivityAsync change
Apr 17, 2019
d8fb077
Merge pull request #1400 from Microsoft/v-kydela/06-using-cards
johnataylor Apr 17, 2019
edfe514
Add deploymentTemplates to 06.using-cards
sgellock Apr 18, 2019
c52e1c4
Removes reference to deleted QnaWithAppInsights csproj from sln file …
gabog Apr 18, 2019
e82f9df
fix missing await in onTurnError hanlder
sgellock Apr 18, 2019
ef25bee
Merge branch 'samples-work-in-progress' of https://github.com/Microso…
sgellock Apr 18, 2019
9882cf6
Fixes #1417 - Sample Address/Port Doesn't Match HTML Page's Instructions
sgellock Apr 18, 2019
93ce376
Updated formatting
tdurnford Apr 18, 2019
cf5714e
Merge pull request #1401 from tdurnford/samples-work-in-progress
johnataylor Apr 18, 2019
8c3a440
[JS][11.QnAMaker] Update for 4.3.4 (#1397)
mdrichardson Apr 19, 2019
a5aa227
Lint Node using-cards
Apr 20, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT License.

using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Bot.Builder;
Expand All @@ -11,18 +12,48 @@ namespace Microsoft.BotBuilderSamples
{
public class ProactiveBot : ActivityHandler
{
// Message to send to users when the bot receives a Conversation Update event
private const string WelcomeMessage = "Welcome to the Proactive Bot sample. Navigate to http://localhost:3978/api/notify to proactively message everyone who has previously messaged this bot.";

// Dependency injected dictionary for storing ConversationReference objects used in NotifyController to proactively message users
private ConcurrentDictionary<string, ConversationReference> _conversationReferences;

public ProactiveBot(ConcurrentDictionary<string, ConversationReference> conversationReferences)
{
_conversationReferences = conversationReferences;
}

private void AddConversationReference(Activity activity)
{
var conversationReference = activity.GetConversationReference();
_conversationReferences.AddOrUpdate(conversationReference.User.Id, conversationReference, (key, newValue) => conversationReference);
}

protected override Task OnConversationUpdateActivityAsync(ITurnContext<IConversationUpdateActivity> turnContext, CancellationToken cancellationToken)
{
var conversationReference = turnContext.Activity.GetConversationReference();
_conversationReferences.TryAdd(conversationReference.Conversation.Id, conversationReference);
return Task.CompletedTask;
AddConversationReference(turnContext.Activity as Activity);

return base.OnConversationUpdateActivityAsync(turnContext, cancellationToken);
}

protected override async Task OnMembersAddedAsync(IList<ChannelAccount> membersAdded, ITurnContext<IConversationUpdateActivity> turnContext, CancellationToken cancellationToken)
{
foreach (var member in membersAdded)
{
// Greet anyone that was not the target (recipient) of this message.
if (member.Id != turnContext.Activity.Recipient.Id)
{
await turnContext.SendActivityAsync(((Activity)turnContext.Activity).CreateReply(WelcomeMessage), cancellationToken);
}
}
}

protected override async Task OnMessageActivityAsync(ITurnContext<IMessageActivity> turnContext, CancellationToken cancellationToken)
{
AddConversationReference(turnContext.Activity as Activity);

// Echo back what the user said
await turnContext.SendActivityAsync(((Activity)turnContext.Activity).CreateReply($"You sent '{turnContext.Activity.Text}'"), cancellationToken);
}
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
using System.Collections.Concurrent;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
Expand All @@ -25,6 +27,14 @@ public NotifyController(IBotFrameworkHttpAdapter adapter, ICredentialProvider cr
_adapter = adapter;
_conversationReferences = conversationReferences;
_appId = ((SimpleCredentialProvider)credentials).AppId;

// If the channel is the Emulator, and authentication is not in use,
// the AppId will be null. We generate a random AppId for this case only.
// This is not required for production, since the AppId will have a value.
if (string.IsNullOrEmpty(_appId))
{
_appId = Guid.NewGuid().ToString(); //if no AppId, use a random Guid
}
}

public async Task<IActionResult> Get()
Expand All @@ -33,7 +43,14 @@ public async Task<IActionResult> Get()
{
await ((BotAdapter)_adapter).ContinueConversationAsync(_appId, conversationReference, BotCallback, default(CancellationToken));
}
return Ok();

// Let the caller know proactive messages have been sent
return new ContentResult()
{
Content = "<html><body><h1>Proactive messages have been sent.</h1></body></html>",
ContentType = "text/html",
StatusCode = (int)HttpStatusCode.OK,
};
}

private async Task BotCallback(ITurnContext turnContext, CancellationToken cancellationToken)
Expand Down
3 changes: 3 additions & 0 deletions samples/csharp_dotnetcore/16.proactive-messages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ if a bot requires some time to compile a response to the user's question, it may
and allow the conversation to continue in the meantime. When the bot finishes compiling the response to the
question, it will share that information with the user.

This project has a NotifyController with an endpoint that will trigger the proactive messages to be sent to
all users who have previously messaged the bot.

# To try this sample

- Clone the samples repository
Expand Down
1 change: 1 addition & 0 deletions samples/csharp_dotnetcore/16.proactive-messages/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Bot.Builder;
using Microsoft.Bot.Builder.BotFramework;
using Microsoft.Bot.Builder.Integration.AspNet.Core;
using Microsoft.Bot.Connector.Authentication;
using Microsoft.Bot.Schema;
Expand Down