Description
I would like to log all interactions with Slack so that I can see what gets sent across the wire.
What type of issue is this? (place an x in one of the [ ])
Requirements (place an x in each of the [ ])
Bug Report
Getting the Request information is fairly easy by doing the following:
// Show Received payload
app.use(async ({ next, payload, body, client, context }) => {
util.prettyJSON(payload, 'RECEIVED (payload): ');
await next();
});
However, getting the Response information has been more challenging. So far, I am doing the following, which works, but probably isn't the best way:
const logSent = config => {
util.prettyJSON(config, 'SENT: ')
return config;
}
// Show sent payload
app.client.axios.interceptors.request.use(logSent, error => Promise.reject(error));
app.use(async ({ next, client }) => {
if (client.fixed !== true) {
client.axios.interceptors.request.use(logSent, error => Promise.reject(error));
client.fixed = true;
}
await next();
});
I would prefer to do this at a framework level in one place, rather than in each individual listener. Is there a better way?
Reproducible in:
package version: 2.0.1
node version: v13.12.0
OS version(s): Mac 10.15.3
Steps to reproduce:
- Send a request to bot
- Send a response via .say()
- Send a response via api.client.[]
- Send a response via listener's client.[]
Expected result:
- Send a request to bot and log the request
- Send a response via .say() and log the response
- Send a response via api.client.[] and log the response
- Send a response via listener's client.[] and log the response
Description
I would like to log all interactions with Slack so that I can see what gets sent across the wire.
What type of issue is this? (place an
xin one of the[ ])Requirements (place an
xin each of the[ ])Bug Report
Getting the Request information is fairly easy by doing the following:
However, getting the Response information has been more challenging. So far, I am doing the following, which works, but probably isn't the best way:
I would prefer to do this at a framework level in one place, rather than in each individual listener. Is there a better way?
Reproducible in:
package version: 2.0.1
node version: v13.12.0
OS version(s): Mac 10.15.3
Steps to reproduce:
Expected result: