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)
- deferInitialization option during App creation is not clearly explained HOT 2
- Dispatch_failed Error for Slack Bot Slash Commands in Socket Mode on GCP VM with Docker HOT 3
- Slack - Support of LLM streaming HOT 5
- Slack Bot works in my workspace, but doesn't respond when Installed elsewhere HOT 21
- AWS Lambda - Slack bolt error on starting AWSLabmdaReceiver HOT 3
- How to build dynamic form HOT 1
- issue in getting bot token HOT 6
- Application not working.........!!!!! HOT 1
- confusions over http method of running slack application HOT 13
- More clearly surface documentation on how to use Bolt.js with HTTP event delivery HOT 3
- custom routes not working HOT 6
- @slack/[email protected] incompatible engine Node 16 HOT 2
- Is there a way to obtain the "text" or "mrkdwn" version of a rich_text_input? HOT 3
- Aws lambda handler not working with oauth express handler HOT 6
- Receiving `reaction_added` events for channels we're not in HOT 2
- Open Modal API is not working suddenly. And error message is `Error: An API error occurred: invalid_trigger_id`. HOT 8
- Cannot post a message as a user via an application/bot HOT 6
- [ERROR] bolt-app no more than 100 items allowed [json-pointer:/view/blocks/0/element/options] HOT 13
- Unhandled request to /slack/install HOT 2
- Unhandled error log when user is not authorized HOT 6
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.