Skip to content

Instantly share code, notes, and snippets.

@pallavtrivedi03
Created March 15, 2019 07:46
Show Gist options
  • Save pallavtrivedi03/a71a71348469ae56444835be7df83646 to your computer and use it in GitHub Desktop.
Save pallavtrivedi03/a71a71348469ae56444835be7df83646 to your computer and use it in GitHub Desktop.
Slash command route (for SlackAppDemo)
router.post('/SlackAppDemo',function(req,res) {
try {
const response = {
response_type: 'in_channel',
channel: req.body.channel_id,
text: 'Hey there...:',
attachments: [{
text: 'What would you like to know in this project?',
fallback: 'What would you like to know in this project?',
color: '#2c963f',
attachment_type: 'default',
callback_id: 'query_selection',
actions: [{
name: 'query_select_menu',
text: 'Choose an option...',
type: 'select',
options: queryOptions,
}],
}],
};
return res.json(response);
} catch (err) {
console.log(err);
return res.status(500).send('Something went wrong :(');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment