Code Monkey home page Code Monkey logo

Comments (5)

nicklambourne avatar nicklambourne commented on June 7, 2024

Hey Andrew, apologies for the delayed response to this, I've been a bit busy with research and thesis work. I like the proposal and will aim to have it implemented in the next day or two.

from slackblocks.

nicklambourne avatar nicklambourne commented on June 7, 2024

Working on this now. I forgot to mention that as a stopgap I'd made the channel field optional on Message for the time being.

from slackblocks.

nicklambourne avatar nicklambourne commented on June 7, 2024

I think I've implemented what is was you're after. It's difficult to run an integration test for this kind of thing without setting up a sever. Let me know if I've overlooked anything.

from slackblocks.

AndrewEckart avatar AndrewEckart commented on June 7, 2024

Looks good! I'll test it out when I get a chance.

It looks like I slightly misread the different ways Slack allows an API server to respond to an interaction. Apparently an "Acknowledgement response" is just a plain HTTP request with a 200 status, which must be sent within 3 seconds (this just prevents a little error icon from appearing next to the button the user clicked in Slack).

What you implemented, and what I originally thought of as an acknowledgement response, actually has the very generic name of "Message response". Besides not needing a channel (Slack can figure that out from the response URL it gives you), it's basically a typical message with two additional attributes: the boolean replace__original, which you already implemented, and response_type, which can be set to "ephemeral" to send a message only visible to the interacting user.

TL:DR; You can add response_type to the AcknowledgementResponse constructor (or just add an ephemeral boolean argument since that's the only value it can take anyway). You could also rename AcknowledgementResponse to MessageResponse, although imo Slack's terminology is a little confusing. Lastly, the default value for replace_original should probably be False instead of True, but it's not a big deal. Thanks for taking the time to implement it!

from slackblocks.

nicklambourne avatar nicklambourne commented on June 7, 2024

That makes a lot of sense wrt the availability of documentation for AcknowledgementResponses. I've made the suggested changes in the latest version. If you do end up using it, let me know how it goes.

from slackblocks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.