Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

Send response in HTML markup #65

Closed
dieterdemeyer opened this issue Oct 25, 2014 · 4 comments
Closed

Send response in HTML markup #65

dieterdemeyer opened this issue Oct 25, 2014 · 4 comments

Comments

@dieterdemeyer
Copy link

Hello,
is it possible to send a reply with the bot which is HTML markup ?
I would like to send messages to the HipChat room with html markup language in certain plugins, and I can do that using the HipChat API.
Is there some way to make an extension for this ?

Thanks.

@jimmycuadra
Copy link
Collaborator

The HipChat adapter connects via XMPP rather than using the API, so it doesn't have direct support for rich messages. However, there's nothing to prevent you from making HipChat-specific plugins that make API calls when chat routes are triggered, rather than replying to the message with Lita's API.

There's been some discussion around this at litaio/lita-hipchat#7 that you might like to participate in as well.

@dieterdemeyer
Copy link
Author

Would writing a Lita extension help for this issue ?
I'm trying it out as we speak but I can't get the actual response.reply that would normally be assembled and returned in a route command to be passed to the extension.
Am I in the right direction ?
I'm using the trigger_route hook for the extension and in my plugin that would send a message with the API, the route looks like:

route(/^do something$/, command: true, use_hipchat_api: true) do |response|
  response.reply "answer" # this answer should be sent through the API, not the standard XMPP...
end

@jimmycuadra
Copy link
Collaborator

Depends how it's implemented, but I'm not sure that hook would help you in this case, really. You might want to approach this by writing a separate HipChat adapter that uses the HTTP API instead of XMPP.

@jimmycuadra
Copy link
Collaborator

I'm gonna close this in favor of #66, which is a proposal for a more generic mechanism for handling rich messages. It's been brought up a few times before, so hopefully this can be a workable solution.

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

No branches or pull requests

2 participants