Closed alsuga closed 6 years ago
@alsuga , what do you mean? Do you want bot to react with some delay? Or is it that you want it to act proactively?
If you want bot to delay response, then you could use simple action like this:
const Promise = require('bluebird')
const ms = require('ms')
const actions = {
wait: async (state, event, { delay }) => {
await Promise.delay(ms(delay || '1s'))
}
}
If you want bot to act proactively, you can check appropriate receipt.
I think he is talking about timeout of a conversation, if the user doesn't reply after X minutes. Could you point him to that direction? Look for the bp_timeout event. We should document that as well.
See botfile
On Wed, Jun 13, 2018, 11:00 AM Alex Pletnov notifications@github.com wrote:
@alsuga https://github.com/alsuga , what do you mean? Do you want bot to react with some delay? Or is it that you want it to act proactively?
If you want bot to delay response, then you could use simple action like this:
const Promise = require('bluebird')const ms = require('ms')const actions = { wait: async (state, event, { delay }) => { await Promise.delay(ms(delay || '1s')) } }
If you want bot to act proactively, you can check appropriate receipt https://botpress.io/docs/beta/recipes/proactive/.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/botpress/v12/issues/299, or mute the thread https://github.com/notifications/unsubscribe-auth/ABQStFBmKFduzJY4n98wfxa1h7UGZ-2tks5t8VNTgaJpZM4UlKeV .
@alsuga , indeed you can check botfile for theses options:
dialogs: {
timeoutInterval: '2m', // How much time should pass before session is considered stale
janitorInterval: '10s' // How often do we check for stale sessions
},
It's also possible to perform actions on timeout. You can create a flow called timeout.flow.json
and it'll get called on timeout. You can also create a node called timeout
- it'll be called in case user got stuck in the same flow as that node.
@slvnperron , I wasn't able to get first 2 options work and there's a PR (https://github.com/botpress/botpress/pull/639) making 4-th option work.
@alsuga , let me know if this didn't help.
@epaminond The first two options are used / configured when modifying the flows file manually. We don't have a UI or API for that yet, but will come. Can you document that as well in the documentation?
ok, sure
is there a way to remove timeout, I mean session should not expire forever as facebook bot does.
Make sure these checkboxes are checked before raising an issue, thank you!
6.10
Please also fill in these fields:
Botpress version:
1.1.13
Channels: slack, hangouts-chat