Cloudkibo / KiboPush

0 stars 1 forks source link

Whatsapp Chatbot interrupts when customer wants to talk to agent #10828

Closed sojharo closed 3 years ago

sojharo commented 3 years ago

On Whatsapp commerce chatbot, we have recently introduced the feature to let customer select option to talk to agent. This sends notification to agents and agents can start to chat with the customer.

When agent sends a message to customer, customer receives the message correctly, but when customer replies to respond to agent, the chatbot interrupts by saying invalid response.

This talk to agent logic needs to be completed further where it pause the chatbot for some times for that particular customer who has chose to talk to agent.

We should have following things:

  1. Once the customer has chosen to talk to agent, then chatbot should be paused for that particular customer for some specific time.
  2. When agent responds customer will be able to reply to that agent and nothing will come from chatbot at that point.
  3. During the time chatbot is paused and agent has not responded yet and customer wants to send a message, chatbot should notify that bot is paused and agent will contact you soon. And, give the option to unpause the chatbot and cancel session with human agent.
jekram commented 3 years ago

We have already implemented all of this logic before for Whatsapp Chatbot. We should not be implementing custom logic for each Chatbot. Please explain why we cannot leverage that logic

bjafri5 commented 3 years ago

Currently, WhatsApp chatbot does not pause when an agent sends a message. I'll be leveraging the existing Messenger logic to add it to WhatsApp.

Currently, when the user selects 'Talk to Agent', it doesn't pause the chatbot. I've discussed with @sojharo and he suggested that the following two things should happen when user selects 'Talk to Agent':

  1. It should pause the chatbot
  2. If an agent hasn't responded, it should send a message asking if the user wants to unpause the chatbot and cancel the human agent request
sojharo commented 3 years ago

Yes, we have done this work Messenger chatbot and we will be reusing the same logic in Whatsapp now. In the whatsapp logic, we would now check before sending the message about this settings (which is set in settings) and then decide whether to send the whatsapp response or wait.

I have asked here for one more enhancement that if customer opts to Talk to Agent and until agent replies, the chatbot should let the customer know that agent will respond you whenever customer sends the message. i.e. if agent has not replied yet and customer sends another message while bot is waiting for agent to respond then bot should say that agent will respond to you soon. Bot should give option to customer to cancel the Talk to Human session and continue with the chatbot if he wishes.

bjafri5 commented 3 years ago

This is in progress. Will try to finish this up on Monday

bjafri5 commented 3 years ago

This is complete. @sojharo please test on production

jekram commented 3 years ago

@sojharo we need to test and close the issues

sojharo commented 3 years ago

I have tested this and it is working fine.