Comments (5)
It would be useful to define middleware on a per matcher basis similar to express.js
router.METHOD(path, [callback, ...] callback)
You can provide multiple callbacks, and all are treated equally, and behave just like middleware
This way you could
slapp.command('/foo', myMiddleware, (msg) => {
// do stuff
})
slapp.action('someaction', 'answer', myMiddleware, (msg) => {
// do stuff
})
function myMiddleware(msg, next} {
// do stuff
next()
}
from bolt-js.
If we would add middleware for outgoing messages, how would we distinguish from incoming middleware which is currently slapp.use
.
Something like this?
slapp.useIn
and slapp.useOut
or
slapp.useIncoming
and slapp.useOutgoing
from bolt-js.
Also, would this be triggered off of msg.say
and msg.respond
or a wrapper around slapp.client
so that any call would proxy through the middleware allowing you to match in any criteria that matches certain API calls like chat.postMessage
or reactions.add
. If it was a proxy to slapp.client
it would be a good way to capture and track metrics. Also, incoming middleware has access everything incoming as well.
from bolt-js.
more options: slapp.in()
and slapp.out()
- might be too vague?
from bolt-js.
In Bolt v1, we added the ability to pass a post-processing function into next()
(which must call done()
). Post-processing functions are called after all of the listener middleware on the way back up the execution chain (to do things like handle propagated errors)
from bolt-js.
Related Issues (20)
- Intermittent UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'type' of undefined HOT 2
- How do you develop at 2 at the same time with Slack? HOT 2
- Incorrectly formatted threaded broadcast reply message will raise `thread_broadcast` event HOT 6
- `PinnedMessageItem` interface missing `ts` HOT 1
- Multiple fields missing in `ChannelCreatedEvent` interface
- (Set a clear title describing the issue) HOT 2
- `client.chat.postMessage` with a user token throws `invalid_auth` error HOT 3
- Allow in thread response in `respondFn` HOT 1
- How do I ignore threaded messages from within the message listener? HOT 3
- ERROR : Please try again or contact the app owner (reason: slack_oauth_missing_code) HOT 15
- chat:write:bot permission needed even though I have chat:write permission HOT 5
- Slack Block Builder do not update static select value in modal HOT 2
- Keep getting ETIMEDOUT errors / warning messages HOT 7
- How to get rich_text_input in slack modal ? HOT 13
- Receiving multiple events for simple messages in web socket mode HOT 1
- Upgrade axios to resolve CVE-2024-39338 HOT 3
- Supporting for Socket client & server timeout missing HOT 5
- Install and authorize multiple slack app clients with a single bolt js server HOT 3
- Using bolt's redirect URI for OIDC HOT 10
- Bolt App Methods Hanging with `ETIMEDOUT` Warning During `chat.postMessage` Execution HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bolt-js.