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

Defining adapter-dependent actions #81

Open
dysnomian opened this issue Jan 29, 2018 · 2 comments
Open

Defining adapter-dependent actions #81

dysnomian opened this issue Jan 29, 2018 · 2 comments

Comments

@dysnomian
Copy link

tl;dr I'd like to use Slack-specific features like ephemeral messages in my responders, and I'm not sure the best approach for it. Is there a place to talk about hedwig? IRC, Gitter, Slack?

The long version:

The Slack bot in question currently uses elixir-slack, which provides a few functions that aren't currently covered by Hedwig. For example, it knows how to set a channel topic, which we used for team status and quick updates.

There are also some Slack features it doesn't implement that would be extremely useful in our bot, such as reactjis, threaded messages, and ephemeral messages.

I've implemented all these in different ways, and could fire off a bunch of pull requests for Hedwig and hedwig-slack if they'd be welcome. However, I'm not clear on how to implement them on the Hedwig side, or (maybe this is getting into the weeds a bit) whether that even fits with the Hedwig philosophy.

Suppose I want to respond to certain keywords by starting or joining a thread. Ideally, I want an ephemeral_reply helper function on the Hedwig.Responder module, and that would pass it along to the adapter. Easy peasy. But the concept of an ephemeral message doesn't exist in other adapters.

It seems like in some way, Hedwig needs to know about the existence of these kinds of actions at least enough to test them, and ideally implement them in the shared Responder helpers, but that opens a whole error handling can of worms...

@scrogson
Copy link
Member

@dysnomian thanks for reaching out!

I'd love to hear a little bit more detail about what changes you would need to make in order to support your use-case. I've only ever used and intended to use the RTM API for the Slack Adapter.

Since responders are invoked asynchronously they can do anything practically anything you want already. So if you need to reply to a message via the Web API, you can do that instead and just have the responder return :ok.

If you want to chat about this further, feel free to ping me on the Elixir Slack channel. I've got a #hedwig channel there as well.

@matthewoden
Copy link

So I've been working around similar issues - one thing that'd be great would be access to the original message. Threading via the Web API needs fields that aren't on the Message struct.

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

3 participants