Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto add additional user/hubot to livechat rooms #3574

Closed
david-strejc opened this issue Jun 16, 2016 · 19 comments
Closed

Auto add additional user/hubot to livechat rooms #3574

david-strejc opened this issue Jun 16, 2016 · 19 comments

Comments

@david-strejc
Copy link

Are there any plans to integrate hubot into livechat?

I need to have hubot online in our live chat.

Is there a way how to do that?

@geekgonecrazy
Copy link
Contributor

This would be a cool integration. So technically its possible. Because livechat rooms are just like normal channels. So it would be a matter of getting hubot added into those rooms. By adding hubot as the sole agent maybe and then have hubot add someone to the room if need be?

@geekgonecrazy geekgonecrazy changed the title Hubot livechat Auto add additional user to livechat rooms Jun 16, 2016
@geekgonecrazy geekgonecrazy changed the title Auto add additional user to livechat rooms Auto add additional user/hubot to livechat rooms Jun 16, 2016
@ulisesguerrero
Copy link

If I set the bot as sole agent, the bot responds all chats. That's nice.

Then, if I login as LiveChat manager, click on "current chats", one can see/participate in the conversation between bot and user.

If a manager could just simply see all current chats on the left toolbar, even though he is not the designated agent. One quick solution would be to display all the rooms in the menu for managers instead of filtering the ones to other agents.

@NoahDragon
Copy link

I'm using the internal hubot. It works well in normal channels, but in the livechat room, it didn't response any message. I'm not sure if it is caused by the rocket.chat is not support bot in livechat?

@FibreFoX
Copy link

Maybe hubot has no connection to these special rooms? I'm interested in this topic and just started to dive in, but having some HUBOT being the first participant on a livechat might bring "conversational ui" with RocketChat ;)

@timkinnane
Copy link
Contributor

Is this resolved by PR #8933 / Issue #5191 - or does it relate to external hubots instances as well?

@timkinnane timkinnane added this to Backlog in Bots Roadmap via automation Mar 20, 2018
@geekgonecrazy
Copy link
Contributor

Technically you can add hubot to room.

We actually use hubot to answer and transfer to humans

Bots Roadmap automation moved this from Backlog to Done Mar 30, 2018
@YuhuaDeng
Copy link

YuhuaDeng commented May 1, 2018

@geekgonecrazy . could you share me how to use hubot to answer and transfer the conversation to human. could you help me check what's wrong with following script,

module.exports = (robot) => {
  robot.respond(/live/i, function(res) {
    const hubotPackage = require.main.require('hubot/package.json')
    const adapterPackage = require.main.require('hubot-rocketchat/package.json')
    const sdkPackage = require.main.require('@rocket.chat/sdk/package.json')
	
	 var transferData =  {
        roomId: res.envelope.room,
        departmentId:           "e3HMKn9dbubKBcZen"  // a fixeed 
        }
	 robot.adapter.callMethod('livechat:transfer',transferData).then((result) => {
		 console.log("==========transfer=======");
	 });
	

  })
}

when I run it, I also get following error message

[Tue May 01 2018 09:44:02 GMT+0100 (GMT Daylight Time)] ERROR [createDirectMessage] Error: { isClientSafe: true,
  error: 400,
  reason: 'Match failed',
  message: 'Match failed [400]',
  errorType: 'Meteor.Error' }
(node:20364) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): #<Object>

@vnuness
Copy link

vnuness commented Jun 15, 2018

@geekgonecrazy
how can I use the hubot to transfer to human service within livechat?

Is there a specific method?

We currently use the code below:

robot.hear(/(suporte)/i, (res) => {
res.send('Aguarde um momento...')

	robot.messageRoom('transferencia', "Atenção! Novo cliente na área")
	
	var params = {
		roomId: res.envelope.room,
		departmentId: "hnaX5WWETBbE9hQnd"
	}
	
	robot.adapter.callMethod('livechat:transfer'params).then((result) => {
		console.log(result)
	})
	
})

Can you help us?

@geekgonecrazy
Copy link
Contributor

@leolage
Copy link

leolage commented Jul 20, 2020

@vnuness can you have sucessfull? I have same problem of you... can you share the solution?

Thanks

@vnuness
Copy link

vnuness commented Jul 20, 2020

Hello @leolage !! I used an external human service, that is, in the livechat.js, when a received an specific behavior, I called an external API and did a redirect.

@leolage
Copy link

leolage commented Jul 22, 2020

Thanks for fast response @vnuness and explanation

I will use whatsapp (via twilio) and livechat on site, do you know if i can do this redirect via livechat.js? This proceed is documented to me implement?

Thanks

@renatobecker
Copy link
Contributor

renatobecker commented Jul 22, 2020

We have now a new approach to implement this kind of integration, based on Apps. So it's easy to integrate Rocket.Chat/Omnichannel to external systems, we just published a new App that integrates Rocket.Chat and Dialogflow, it's available in our marketplace already.
Other chatbot adapters(Apps) are coming soon, so the Hubot might be one of them.

@vnuness
Copy link

vnuness commented Jul 24, 2020

@leolage, check if the previous explanation help you. If not, if you mastered web development, you can create a web application that will take care of your whatsapp integration and redirect the livechat to your page. For example:
When user types 1 in livechat (you can manipulate this in livechat.js) you will use "location.href = 'yourdomain.com'".
I hope that this help you.
Hugs.

@leolage
Copy link

leolage commented Aug 3, 2020

Thanks @vnuness for this tip, I will try.

@renatobecker thanks for share this information, I dont found a tutorial to config RocketChat with Dialogflow, can you share please? I try to configure here but cant do it usefull.

Thanks again.

@renatobecker
Copy link
Contributor

Thanks @vnuness for this tip, I will try.

@renatobecker thanks for share this information, I dont found a tutorial to config RocketChat with Dialogflow, can you share please? I try to configure here but cant do it usefull.

Thanks again.

You just need to install the App and then set it up. If you have a Dialogflow chatbot agent, you just need to set the credentials to the App and everything will work fine.

@leolage
Copy link

leolage commented Aug 4, 2020

Ok @renatobecker I tryed it. But dont worked yet, and I dont found a problem... on logs all request to DialogFlow return null... do you already saw this?
I already setup app and dialogflow
Instance: bRjmZrvWgAdZRtBrW debug: 2020-08-04T11:40:36.613Z Caller: anonymous OR constructor [ "onSettingUpdated is being called..." ] info: 2020-08-04T11:40:36.628Z Caller: run -> run [ "------------------ Google Credentials validation Success ----------------" ] info: 2020-08-04T11:40:36.664Z Caller: run -> run [ "------------------ Google Credentials validation Success ----------------" ] info: 2020-08-04T11:40:36.684Z Caller: run -> run [ "------------------ Google Credentials validation Success ----------------" ] info: 2020-08-04T11:40:36.693Z Caller: run -> run [ "------------------ Google Credentials validation Success ----------------" ] info: 2020-08-04T11:40:36.696Z Caller: run -> run [ "------------------ Google Credentials validation Success ----------------" ] debug: 2020-08-04T11:40:36.696Z Caller: anonymous OR constructor [ "'onSettingUpdated' was successfully called! The result is:", null ]

@leolage
Copy link

leolage commented Aug 4, 2020

when I sent a message to bot user @dialogflow.bot on rocketchat:

Instance: bRjmZrvWgAdZRtBrW
debug: 2020-08-04T11:47:48.357Z Caller: anonymous OR constructor
[
"executePostMessageSent is being called..."
]
debug: 2020-08-04T11:47:48.360Z Caller: anonymous OR constructor
[
"'executePostMessageSent' was successfully called! The result is:",
null
]

I dont found a log on dialogflow/googlecloud logs

@renatobecker
Copy link
Contributor

when I sent a message to bot user @dialogflow.bot on rocketchat:

Instance: bRjmZrvWgAdZRtBrW
debug: 2020-08-04T11:47:48.357Z Caller: anonymous OR constructor
[
"executePostMessageSent is being called..."
]
debug: 2020-08-04T11:47:48.360Z Caller: anonymous OR constructor
[
"'executePostMessageSent' was successfully called! The result is:",
null
]

I dont found a log on dialogflow/googlecloud logs

This doesn't mean the requests are returning null, this is a bad implementation of the app logs, they're not displaying the correct information.
As you can see from your previous comment, the setup succeeded: Google Credentials validation Success.

I can't provide any additional information since I don't have access to your Dialogflow chatbot agent, but you can run our develop branch on your local environment and check the payload you get from Dialogflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Bots Roadmap
  
Done
Development

No branches or pull requests