问题
I am using the bot framework to build a quiz bot and I want the person to get a message from the bot if they become inactive in 2 mins. When I tried
bot.dialog('/', [(session)=>{
session.dialogData.inactive = setTimeout(()=>{
session.send('You there?')
},30000)
}])
It gives me this error
TypeError: Converting circular structure to JSON
at Object.stringify (native)
at addWrite (D:\bots\zupquiz\node_modules\botbuilder\lib\bots\ChatConnector.js:261:29)
at ChatConnector.saveData (D:\bots\zupquiz\node_modules\botbuilder\lib\bots\ChatConnector.js:276:21)
at D:\bots\zupquiz\node_modules\botbuilder\lib\bots\UniversalBot.js:405:21
at UniversalBot.tryCatch (D:\bots\zupquiz\node_modules\botbuilder\lib\bots\UniversalBot.js:425:13)
at UniversalBot.saveStorageData (D:\bots\zupquiz\node_modules\botbuilder\lib\bots\UniversalBot.js:402:14)
at Object.onSave (D:\bots\zupquiz\node_modules\botbuilder\lib\bots\UniversalBot.js:266:27)
at Session.sendBatch (D:\bots\zupquiz\node_modules\botbuilder\lib\Session.js:381:22)
at Timeout.<anonymous> (D:\bots\zupquiz\node_modules\botbuilder\lib\Session.js:513:23)
at ontimeout (timers.js:365:14)
at tryOnTimeout (timers.js:237:5)
at Timer.listOnTimeout (timers.js:207:5)
来源:https://stackoverflow.com/questions/41569285/what-is-the-right-way-to-message-the-user-after-120-seconds-of-inactivity-in-my