Created
March 15, 2019 07:46
-
-
Save pallavtrivedi03/a71a71348469ae56444835be7df83646 to your computer and use it in GitHub Desktop.
Slash command route (for SlackAppDemo)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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