I have created a slack bot which works correctly on my machine, I have created prompts in slack bot and when the user clicks on the prompts the dialog(a type of form in slack) opens. Once the dialog is submitted another prompt comes up and corresponding dialog. I have attached the gif of the whole process.
My issue is when another user in my slack workspace tries to communicate with the slack bot he gets the become a tutor form but once he submits that form he doesn't get the second prompt where he can add subjects. I have tried to host the application on my machine as well as on the remote machine on heroku, but the issue remains the same.
The code for opening a dialog is:
const axios = require('axios');
const debug = require('debug')('botProject:src/slack_bot');
const qs = require('querystring');
module.exports = {
open_dialog: function(dialog,res) {
axios.post('https://slack.com/api/dialog.open', qs.stringify(dialog))
.then((result) => {
debug('dialog.open: %o', result.data);
console.log("Dialog Opened sucessful");
res.send('');
}).catch((err) => {
debug('dialog.open call failed: %o', err);
res.sendStatus(500);
});
}
}
For any other code you can visit our github source code: https://github.com/rikenshah/WolfTutor
Any help would be appreciated.
After struggling for 2 days I found a fix for this issue. While sending a reply I was sending the slack verification token and that token was for that particular user, so when the person who has created the app made a request he was getting the reply, but when someone else did slack failed to verify him and did not even give any error. To fix this issue now I am verifying the requests through bot user instead of a particular user and that fixed my issue.