Git Product home page Git Product logo

Comments (4)

seratch avatar seratch commented on September 15, 2024 2

Since this message subtype pattern is not yet available in our public document here, I've removed the "bug" label from this issue. With that being said, once we add this pattern to the document, we should support the event payload out of the box!

from java-slack-sdk.

zimeg avatar zimeg commented on September 15, 2024 1

@mgroth0 no problem! I haven't tested this myself, but a bit more typing might be needed to satisfy the complete channel_convert_to_public patterns I think. I'd recommend referencing the parsing for MessageChannelArchiveEvent using the above values for now:

I'm not sure when SDK support might be added either, but I'm searching for more info on the actual event! 📚

You wouldn't happen to know if there is a way with Slack webhooks to generate fake events of every type for testing purposes would you?

This is a wishlist item of mine haha 🎁 👀 Right now no, but our developer program offers sandboxed workspaces just for testing! It's not quite programatic but is still so super useful for testing edges 🙏

from java-slack-sdk.

zimeg avatar zimeg commented on September 15, 2024

Hi @mgroth0! 👋 I'm looking into this now, but I can confirm that the channel_convert_to_public event is from a message subtype with a payload that resembles:

{
  subtype: 'channel_convert_to_public',
  user: 'U02APLEMRPS',
  text: 'made this channel *public*. Any member in this workspace can see and join it.',
  type: 'message',
  ts: '1723680078.026719',
  channel: 'C07GX2G5F1T',
  event_ts: '1723680078.026719',
  channel_type: 'channel'
}

While this isn't documented at the moment and until we have formal SDK support for it, is it possible to deserialize this using the message subtype as a workaround?

from java-slack-sdk.

mgroth0 avatar mgroth0 commented on September 15, 2024

Hey @zimeg Thanks for looking into this!

So if I understand correctly, you would suggest as a workaround to using gson.fromJson(jsonString,MessageEvent::class.java). That sounds reasonable!

Unfortunately I don't have a quick way to test if this works (and this event is pretty rare in my organization so I don't know when I'll see it again). So I can't confirm whether or not it works, but I do appreciate the workaround!

You wouldn't happen to know if there is a way with Slack webhooks to generate fake events of every type for testing purposes would you? The best way I could think of would be to create my own "test organization/workspace", install my app there, then manually do stuff in the slack app to generate a bunch of events. Basically, not programatic at all (therefore I won't be doing that). It would be nice if there was some testing framework that could just send fake events (with the same format as real events) automatically.

from java-slack-sdk.

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.