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

How can i unsubscribe? #111

Closed
MarcosEllys opened this issue Apr 12, 2019 · 1 comment
Closed

How can i unsubscribe? #111

MarcosEllys opened this issue Apr 12, 2019 · 1 comment

Comments

@MarcosEllys
Copy link

Hi @timkinnane, first congratulations about Bbot, it's amazing and easily to use, but, i have one question, when a forward one chat on livechat i keep getting events, do you know how can cancel the subscription and stop stream messages for my bot?

@timkinnane
Copy link
Contributor

@MarcosEllys that is an excellent question. I haven't had that requirement yet, so there's no high level method to control per-room subscriptions. Assuming you mean Rocket.Chat Livechat, the subscription receives all messages from all rooms the bot has joined. What you can do is use the Rocket.Chat SDK driver exposed within the bot adapter to manually call a server method to leave the room with the bot.

I think it would be something like: bot.adapters.message.driver.callMethod('leaveRoom', rid)

I've got a new release of bBot ready to go, just missing docs and the time to write them currently.
This new release uses an entirely new library to connect to Rocket.Chat, that offers better control for this kind of stuff and I'm making examples specifically for Livechat, because that seems very popular. I'll try and include something to address your need, if you can describe the requirement further. I'm assuming you're doing first response via bot then hand-off to a live agent and you need the bot to go away?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants