slacker icon indicating copy to clipboard operation
slacker copied to clipboard

any advice on how to use for handling events like reacts, home opened and others?

Open sheldonhull opened this issue 1 year ago • 6 comments

I'm a bit confused on how I can properly use this to handle events like react added. When I create the bot := slacker .... it has the SocketModeHandler as part of the struct, but I'm unclear on the proper registration of handling specific events and had trouble translating from go-slack to this. No "HandleEvents" type methods existed, only unsupported interactions seemed available.

Any tips for handling event triggers, any examples? I'll do some github searching for more outside this repo, but figured I'd ask in case anyone has something to share :-)

sheldonhull avatar Jun 21 '24 20:06 sheldonhull

Could you give us examples to clarify your needs?

If I understand correctly, you would like to handle the action of someone reacting with an emoji?

raed-shomali avatar Jul 01 '24 01:07 raed-shomali

Yeah, so I see examples on go-slack on how to setup handling for things like reacts, app home entered, and others, but when I look at bot.SocketModeClient() i couldn't find any clear way to register specific handlers.

As a start, being able to trigger on apphome opened and specific react being added would be great. I want to do more with action/blockid soon and I realized a lot of the stuff comes up under "unsupportedinteraction" and has to be custom routed, so looking for some inspiration to better handle mapping of handlers for events.

sheldonhull avatar Jul 03 '24 22:07 sheldonhull

bump @raed-shomali if you get the time. Just wanted to make sure you saw this. I love using slacker instead of setting all this up but the socketmodeclient and registering certain events is really unclear. Any guidance would be appreciated.

sheldonhull avatar Jul 10 '24 21:07 sheldonhull

I see. I do not think this is currently supported in a straightforward manner, but I do not see why we couldn't add handlers to support such cases.

Originally, Slacker only supported handling commands. Then we added handlers to support action/block interactions and later on Cron Jobs.

Would you like to take a stab at it and put together a PR to support handling reactions and such?

raed-shomali avatar Jul 11 '24 01:07 raed-shomali

@raed-shomali if you have a quick couple bullet points on guidance, I'll be glad to take a peek if I can get some spare time. Nothing detailed, just looking for a quick pointer at an example so I make sure I'm on the right track.

sheldonhull avatar Jul 23 '24 00:07 sheldonhull

I think a good starting point would be to research what events do we get for reactions and AppHome interactions

If we do receive event, then it becomes a straightforward problem to solve. If we don't, it will be more complicated

raed-shomali avatar Jul 23 '24 13:07 raed-shomali