Closed Mattw11486 closed 2 years ago
One thing to note is that I am trying to link this up with MongoDB. The reason being is so that it can store what the bot heard, along with if the response to the user answered their question. This is why the block actions resides within the controller.hears function. That way when/if a user selects "Yes" or "No" Button it updates to the collection in Mongo. If I remove the controller.on outside of controller.hears I do not get the repeat issue..however, I also do not get the resolution updated to Mongo. At least I haven't found a better way to do this.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Sorry for the very slow response here @Mattw11486 ---
the problem is that you are defining the handler for block_actions inside of another handler. That means it gets duplicated each time the handler is fired.
Make sure all your controller.on
and controller.hears
statements are at the same level of code - never inside each other.
I have a weird issue where block actions keep adding an additional repeated message per each conversation. For example I have the bot responding to both the keywords 'vpn' or 'password reset'. After it responds to the message it also then provides a yes or no block action button to select to see if the response was helpful or not.
If I reboot the bot and select 'yes' or 'no' it responds once, however if I then ask the question again and select yes or no it repeats the response twice. If I ask again and select 'yes' or 'no' it repeats it 3 times again 4 times, etc etc. It will continue to add an additional repeat until I reboot the bot again. Is there a way to solve this?
See attached screenshot for example: