Skip to content

BotBuilder v3 Node.js bot with Redux state management

License

Notifications You must be signed in to change notification settings

matthewshim-ms/Redux-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Redux-Bot

redux-abs-logo

BotBuilder v3 Node.js bot with Redux state management

To-do

  • More tests for Redux
  • Cleaner code inside app.js
  • Investigate possibility to use ChatConnector directly

Hiccups

Turning conversationUpdate event into an action

It would be great if a new member joined, we sent a welcome message right away.

  • bot.on('conversationUpdate') event handler does not associate with session object
  • session object is required to create a Redux store

Looking at other sample code on the same scenario, instead of sending the greeting thru session.send, it must be sent thru bot.send with an addressed message. Thus, it further proves that conversationUpdate is not associated with any session object.

Because our Redux store design requires session object, thus, conversationUpdate cannot be turn into an action.

Multi-turn dialog

It is intuitive to write code in redux-saga like this:

takeEvery(RECEIVE_MESSAGE, function* (action) {
  yield put(promptText('What is your name?'));

  action = yield take(RECEIVE_RESULT);

  yield put(sendMessage(`Hello, ${ action.payload.response }`);
});

But this would require a dialog to resume in the middle of a saga (resume at the yield take line). Due to the nature of serverless functions, it is difficult to implement a saga that works this way.

References

About

BotBuilder v3 Node.js bot with Redux state management

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published