-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Give an example with buttons and response handling #136
Comments
The RTM API doesn't support interactive messages. You will have to perform these using web API. |
Follow the tutorial of this link https://api.slack.com/tutorials/intro-to-message-buttons |
Here, just add the Example: const params = {
icon_emoji: ':smiley:',
"text": "Would you like to play a game?",
"attachments": [
{
"text": "Choose a game to play",
"fallback": "You are unable to choose a game",
"callback_id": "wopr_game",
"color": "#3AA3E3",
"attachment_type": "default",
"actions": [
{
"name": "game",
"text": "Chess",
"type": "button",
"value": "chess"
},
{
"name": "game",
"text": "Falken's Maze",
"type": "button",
"value": "maze"
},
{
"name": "game",
"text": "Thermonuclear War",
"style": "danger",
"type": "button",
"value": "war",
"confirm": {
"title": "Are you sure?",
"text": "Wouldn't you prefer a good game of chess?",
"ok_text": "Yes",
"dismiss_text": "No"
}
}
]
}
]
};
app.postMessageToChannel(
'general',
'What\'s up laddies!', params
) |
@dumblole How can I listen to the response of the button clicked by the user and take actions regarding that in interactive messages. So as per your example if the user clicks Such as responding with another interactive message of opening a modal. |
@prashant1k99 Did you found a solution for listening to the response? |
@aliehsan90 not yet, if you find it then please do tell us. |
Please, give an example of how to implement a slack bot, which proposes a few options by displaying buttons, and handles the button clicks.
The text was updated successfully, but these errors were encountered: