I am developing a Slack bot using Bolt API in Node.js. The problem I am facing is when I send a slash command, the bot receives and responds to the command successfully but the command is not visible in the channel.
I read the following article https://api.slack.com/interactivity/slash-commands#responding_response_url where it states that I need to add {"response_type": "in_channel"}
slack.js
const { App, LogLevel } = require("@slack/bolt");
app.command("/ask", async ({ command, ack, say, respond }) => {
console.log("command ", command)
console.log("ack ", ack)
await ack();
await say(`Hi <@${command.user_name}>`)
})
(async () => {
const port = 8000
await app.start(port);
console.log(`⚡️ Slack Bolt app is running on port ${port}!`);
})()
I am new to slack API, and I am not able to understand how should I manipulate the request in order to see the commands in the channel as well
Any advice or help is appreciated!