mrkaye97 / slackr

An R package for sending messages from R to Slack
https://matthewrkaye.com/slackr/
Other
307 stars 85 forks source link

Interactive messages #157

Closed featherduino closed 3 years ago

featherduino commented 3 years ago

Use this package to send out ggplots to account execs mostly every week is there anyway i can make the message interactive ?

mrkaye97 commented 3 years ago

Hey @featherduino,

What exactly do you mean by "interactive"? If you just want to customize the message + title, then yes, I think it's possible but not in the current version of slackr. I'll link this issue with #155 and add an argument to ggslackr, slackr_dev, etc.

Hopefully I will have v3.0.0 merged on Monday. This issue will close once that happens.

See the files.upload endpoint docs here: https://api.slack.com/methods/files.upload

mrkaye97 commented 3 years ago

@featherduino to clarify, is this the kind of behavior you'd expect? "My cool plot" is passed through the initial_comment parameter, and "A cool title" is passed through the title parameter.

Screen Shot 2021-06-19 at 4 08 01 PM
featherduino commented 3 years ago

Hey thanks for the reply.

I could achieve that(screenshot) by using slackr_upload, i am looking for something like this image

So the buttons that are there in red and green are interactive and plot changes on clicking them is something like that possible ?

mrkaye97 commented 3 years ago

Aha, I see. I think I'd need to read more here: https://api.slack.com/interactivity and here: https://api.slack.com/apis/connections/socket-implement

My presumption though is that setting up slackr to do this kind of interactive work is beyond the scope of this package, but I'm not 100% convinced of that. At first glance though, it looks like this kind of behavior comes from using web sockets, which would at least take some significant thinking to figure out how to set up, and I don't have any plans to work on this in the near future (although it could be an awesome improvement!).

If you're curious about contributing and wanted to look into some of these features of the Slack API, I'd be more than happy to work with you on it, review code, etc. Contributions like this would be awesome!

Let me know if you have any thoughts, and thanks for putting in the request