Botman: How to config interval time of hearing

Created on 8 Oct 2019  路  5Comments  路  Source: botman/botman

  • BotMan Version: 2.5
  • PHP Version:7.3
  • Messaging Service(s):
  • Cache Driver:

Description:

when start a conversation, the time for waiting from client to type is too short ( around 15 seconds). After 15s, the session out and they have to re-start conversation. Can any one show me how to config that?

Steps To Reproduce:

Most helpful comment

Ok I've set $cacheTime = 3600 in:

/vendor/botman/botman/src/Messages/Conversations/Conversation.php

and that seemed to have helped the issue.

I will continue testing it but I think it works better now.

Maybe there is another way to solve it but as long as this works - great.

All 5 comments

Yes, I have noticed that it drops the conversation after a while and I was looking for some clues on how to fix it. I thought that it is Laravel session but this is by default 2h so not that.

Very important issue and hopefully somebody can answer this.

BTW. How do you know it is 15s?

Yes, I have noticed that it drops the conversation after a while and I was looking for some clues on how to fix it. I thought that it is Laravel session but this is by default 2h so not that.

Very important issue and hopefully somebody can answer this.

BTW. How do you know it is 15s?

Thanks for your reply, it is 30s for hears command. I checked it. When user responses more than 30s to the bot, the conversation becomes inactive. If you type 'hi' to start conversation, it begin a conversation again. does any one know how to config interval time of hears command? Beside, conversation_cache_time and user_cache_time, is there any config for hears command?

I found $cacheTime variable in

/vendor/botman/botman/src/Messages/Conversations/Conversation.php

but there is also storeConversation method in:

/vendor/botman/botman/src/Traits/HandlesConversations.php

that is using the above $cacheTime but if it is not available (which by default it is not) it seems to be using number 30.

however, it says the $cachetime should be in minutes, so that would mean 30 minutes but what if this is a bug or something and 30 actually means seconds?

what makes me think that is that in:

/vendor/laravel/framework/src/Illuminate/Cache/Repository.php

there is a method setDefaultCacheTime($seconds)

I only briefly looked at it and this is what I managed to figure out. Maybe I will look at it later in more detail.

For the project I'm working on, this is a crucial issue to sort out.

Ok I've set $cacheTime = 3600 in:

/vendor/botman/botman/src/Messages/Conversations/Conversation.php

and that seemed to have helped the issue.

I will continue testing it but I think it works better now.

Maybe there is another way to solve it but as long as this works - great.

Thank you very much, Pjoimedia. You save my life.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stefandanaita picture stefandanaita  路  5Comments

hossinasaadi picture hossinasaadi  路  4Comments

antonkomarev picture antonkomarev  路  5Comments

lostertschnig picture lostertschnig  路  3Comments

mofman picture mofman  路  4Comments