0

In this minimal example :

app.message(/Foo/i, async ({ message,say }) => {
  await say("Bar!")
})
app.message(/Snoo/i, async ({ message,say }) => {
  await say("Reddit!")
})

Then oddly enough if I write in Slack :

Snoo
=> Reddit!
Foo
=> Bar!
   Reddit!

It appears that the second app.message automatically runs regardless if its message is called. Perhaps the namespace of say is usurped by the former?

How can I isolate them?

Trip
  • 26,756
  • 46
  • 158
  • 277
  • Question... I'm on the Java SDK and just posted this - @Trip - https://stackoverflow.com/questions/73827813/slack-bolt-java-sdk-multiple-app-message-events-with-different-regex-stomp-on. It seems like multiple app.message() blocks stomp on each other (like totally replace each other). Did you ever get this working or find out more? – John Humphreys Sep 23 '22 at 12:36
  • 1
    No I didn't actually @JohnHumphreys. But in my case, they all appear. – Trip Sep 23 '22 at 14:00
  • 1
    I gave up and made a .* handler and continued to route messages myself inside it with my own patterns from a yaml file. The app.message thing seems very odd :). But oh well. – John Humphreys Sep 24 '22 at 12:58

0 Answers0