botpress / v12

Botpress OSS – v12
https://v12.botpress.com
GNU Affero General Public License v3.0
78 stars 87 forks source link

There is some way to timeout a conversation? #299

Closed alsuga closed 6 years ago

alsuga commented 6 years ago

Make sure these checkboxes are checked before raising an issue, thank you!

Please also fill in these fields:


Botpress version: 1.1.13

Channels: slack, hangouts-chat

epaminond commented 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.

slvnperron commented 6 years ago

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 .

epaminond commented 6 years ago

@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.

epaminond commented 6 years ago

@alsuga , let me know if this didn't help.

slvnperron commented 6 years ago

@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?

epaminond commented 6 years ago

ok, sure

3bu1 commented 5 years ago

is there a way to remove timeout, I mean session should not expire forever as facebook bot does.