Different actions for different adapters (template? but...)

9 views
Skip to first unread message

da...@octo.com

unread,
Aug 18, 2015, 9:39:52 AM8/18/15
to Lita
Hi all,

How could I reply differently according to the adapter currently used?

Here is the case:

I generate an image each time a specific sentence is sent to lita.
I'd like to:

- reply with the image to Slack (or equivalent) when Slack is the Adapter currently used
- save the image locally and reply "ok, done" when Shell is the Adapter currently used --> mainly for test purpose

I'm not sure I can do it with the templates.

How could I do then?

Thank you
David

Alex Soto

unread,
Aug 18, 2015, 1:55:09 PM8/18/15
to da...@octo.com, Lita
I think templates will allow you to do that.  Give it a try and ask again if that doesn't work ;)


--
You received this message because you are subscribed to the Google Groups "Lita" group.
To unsubscribe from this group and stop receiving emails from it, send an email to litaio+un...@googlegroups.com.
To post to this group, send email to lit...@googlegroups.com.
Visit this group at http://groups.google.com/group/litaio.
To view this discussion on the web visit https://groups.google.com/d/msgid/litaio/7e00b535-73d5-4ca8-83cf-2b5721d34f5a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jimmy Cuadra

unread,
Aug 18, 2015, 7:28:08 PM8/18/15
to da...@octo.com, Lita
It depends what you mean by replying with the image for Slack. If you just want to link to an image hosted on the web somewhere, templates can certainly achieve that. If you're talking about sending the image to Slack as an upload or attachment, then templates won't cut it currently. Attachment support doesn't exist yet with the Slack adapter, but there is some discussion of it on GitHub you might want to follow and contribute to:


J

David Alia

unread,
Aug 19, 2015, 6:42:18 AM8/19/15
to Jimmy Cuadra, Lita
This was exactly my question, thank you Jimmy.

I'd like to do something like:

response.reply img.to_blob

but it seems that it is not feasible for the moment, thanks for the pointer anyway.

Thanks
David
Reply all
Reply to author
Forward
0 new messages