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

Send files/attachments #40

Open
jeffweiss opened this issue Apr 19, 2016 · 4 comments
Open

Send files/attachments #40

jeffweiss opened this issue Apr 19, 2016 · 4 comments

Comments

@jeffweiss
Copy link

For a few days I've been prototyping a hedwig-based bot connected to our internal data mart. I've begun to get requests from folks for more complicated responses, and in some cases requests for file attachments.

Example of current situation

Jeff Weiss: @hedwig who's running what version?
Hedwig: /code
Customer         | Version
ACME Tech        | 3.7.1
Alpha, AB        | 3.8.0
...
Zeta Industries  | 3.8.3

This might work fine for a small-ish responses, but pretty quickly becomes unwieldy. And if the folks using hedwig responses are plugging into to something else, we have to compromise between readability and integration.

I'd like your thoughts on adding the ability for file transfer/attachments for responders. Maybe something like reply_with_file(msg, text, file) or send_with_file(msg, text, file)

Example ideal interaction

Jeff Weiss: @hedwig who's running what version?
Hedwig: @jeffweiss who's running which version is a fair bit of data, so here it is as csv
<customer_versions.csv>

Necessary Adapter Changes

Based on some preliminary research, I believe that each of the existing adapters (Slack, HipChat, and IRC) could implement this new functionality.

Non-Hedwig Options

I can use technologies outside of Hedwig to accomplish this, but it requires the user to incur a switching cost as there's now an additional layer between them and what they'd asked for.

  • Send email with attachment (assuming email of asker is known/discoverable)
  • Dropbox/Box
  • Pastebin/Gist

Thoughts?

@scrogson
Copy link
Member

@jeffweiss I love this idea! I'll start thinking about an API for this.

@bjufre
Copy link

bjufre commented Feb 28, 2017

@scrogson I'm wondering if it would be possible to delegate somehow the message to the adapter. As each service has its own types of messages. For example in telegram, to mention one, you can send keyboards.

I'm really asking, as a clarification for a doubt I have, I don't know if it's already in Hedwig. But I'd be a really nice API if not.

Currently at work we've developed something with AWS, kinda like a message gateway, a main entry point for receiving and sending messages (for messenger, kik, line, twilio & telegram), but this delegates to the services or adapters of this services, thus we can send special keyboards, special images, or custom responses without having any kind of limitation.

We've been wanting to change it, completely rewrite it in Elixir, so we can take advantage of what it gives us, like amazing fault tolerance software it's built upon. We were looking around, investigating when we came upon Hedwig, and we really think it could be the answer we've been looking.

Thanks for your attention.
Hope I've explained myself.

@scrogson
Copy link
Member

scrogson commented Mar 7, 2017

I'm wondering if it would be possible to delegate somehow the message to the adapter.

@behind-design what exactly do you have in mind?

The response messages do make their way back to the adapter which is responsible for transforming the %Hedwig.Message{} into whatever is required for the underlying service.

@iref
Copy link

iref commented Sep 11, 2017

I was wondering if type field on %Hedwig.Message{} would be enough to distinguish if responder wants to send normal message or message with attachment (e.g. Slack 'message.attachment' type) or file. Adapters can use pattern matching to compose message needed for their specific messaging protocol.

Is this good idea? I am Elixir/Erlang beginner, so I am not sure if there is better/more idiomatic way how to solve this in Elixir.

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

4 participants