Skip to content
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

Prompt and Hero Card button does not send the respond back to the bot in Slack #327

Closed
aldvintumbelaka opened this issue Dec 20, 2021 · 15 comments
Assignees
Labels
Bot Services Required for internal Azure reporting. Do not delete. Do not change color. customer-reported As opposed to development work item.

Comments

@aldvintumbelaka
Copy link

aldvintumbelaka commented Dec 20, 2021

Hi,

I'm having a problem where I have prompt button or hero card button in Slack.
When the user click the button, it doesn't send any response back to the bot.

Here's my code (using Hero Card)
image
image

Tested it using step.prompt as well using both Hero Card style or I leave style as undefined
image

I try testing it using suggested action as well, but it doesn't render properly in Slack (only render as bullet points)
image
image

I also have enabled the Event Subscriptions in Slack
image

And also enabled Interactivity with https://slack.botframework.com/api/Action as the Request URL

Is there anything that I do wrong on the setup or something?
I'm pretty sure I've followed all steps in here https://docs.microsoft.com/en-us/azure/bot-service/bot-service-channel-connect-slack?view=azure-bot-service-4.0

Note: this is working totally fine in Test in Web Chat, in Direct Line, and Microsoft Teams.

Thanks

@aldvintumbelaka
Copy link
Author

aldvintumbelaka commented Dec 20, 2021

Found this issue, might be related #326 but looks like it's using Slack interactive message

@dmvtech dmvtech added Bot Services Required for internal Azure reporting. Do not delete. Do not change color. customer-reported As opposed to development work item. labels Dec 20, 2021
@aldvintumbelaka
Copy link
Author

aldvintumbelaka commented Dec 23, 2021

Hi @youyu16 Yup I've set the webhook URL as well.
But, if I set the URL to use https://slack.botframework.com/api/Action as per the documentation, it will not work, but if I set it to my ngrok URL, it will work, but looks like it's missing the request body object that is required by the adapter process activity.

it only has payload, callbackid as the request body.
meanwhile, the processActivity required activity_type, etc.

Thanks

@youyu16
Copy link

youyu16 commented Dec 23, 2021

@aldvintumbelaka any exception occur when you sent that action message?
you can find it in web console
image

@youyu16
Copy link

youyu16 commented Dec 23, 2021

Also, if its not work for slack.botframework.com. please check the oauth settings, have you set the endpoint in redirect url
image
please make sure the interactive is on as below
image

@youyu16
Copy link

youyu16 commented Dec 23, 2021

When I click the button on slack I will get full activity with all the things bot needs and the original message from Slack inside ChannelData Filed. could you please put and example of what you received here?

@youyu16
Copy link

youyu16 commented Dec 23, 2021

@aldvintumbelaka this is part of the message what I got
image

@aldvintumbelaka
Copy link
Author

Looks like it's a bit different in mine.
Here's the form data for a normal message
image

And here's the form data from a button
image

@aldvintumbelaka
Copy link
Author

aldvintumbelaka commented Dec 23, 2021

@youyu16 The problem is when I try to pass it to the botframework adapter process activity,
image

it returns me with this message: validateAndFixActivity(): missing activity type

When i do a check, here's the different between the normal message request body and request body that I got from the slack button when clicked.
This is the normal message request body:
image

And this is what i got when a button is clicked in slack
image

Looks like it's automatically being wrapped inside the payload object.

The problem is, in the process activity function from botframework module, it get the req.body straight away.
image

@ssss141414
Copy link

ssss141414 commented Dec 23, 2021

Hi @aldvintumbelaka ,
I just followed all steps in section Create a Slack application using the Azure portal in the doc, from the scratch: https://docs.microsoft.com/en-us/azure/bot-service/bot-service-channel-connect-slack?view=azure-bot-service-4.0#create-a-slack-application-using-the-azure-portal. This is my test result:

1 For sending hero card, it works well. I can click the button and send back title '1'. I'm using C# SDK and this code should construct the same activity with you provided:
image
image

2 For sending SuggestedActions, yes I repro the bug. The button is not rendered. We will try to fix it.

Since we're following the same doc, let's assume our configuration is well, so there are 2 suspicious aspects:
1 There are bugs in js SDK.
2 There are bugs in adapter.
So I want to know, are you using Slack adapter or Azure portal? I mean in this doc, are you following Create a Slack application using the Azure portal(which I just tested) or Create a Slack application using the Slack adapter?

@aldvintumbelaka
Copy link
Author

Hi @youyu16 I'm using the azure portal, not the slack adapter. But, i'm using node js, not the C# SDK. Do you think it might be the issue?

@ssss141414
Copy link

Hi @aldvintumbelaka ,
Since everything goes well in C# SDK in my side, let me try to use js SDK to see if we can repro it. If can't, this shows we missed something in configuration...

@ssss141414
Copy link

Hi @aldvintumbelaka ,
I've tried node js SDK, but everything still went well.

I use sample here: https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/javascript_nodejs/02.echo-bot
And I use your code:
image
But everything worked in my side, with bot echoing '1'.
image

@ssss141414
Copy link

ssss141414 commented Jan 4, 2022

@aldvintumbelaka ,
Hi, any update about this issue? Is there more detail that can help us troubleshoot this issue?

@aldvintumbelaka
Copy link
Author

Hi @ssss141414 sorry i have a limited internet access during new year break, I'm testing it again now. I'll try to redo all the configuration and do another check.

@aldvintumbelaka
Copy link
Author

Hi @ssss141414 I've got it working now. Looks like there is a miss-configuration issue in the redirect url and event subscriptions.
Thanks for your help. I'll now close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bot Services Required for internal Azure reporting. Do not delete. Do not change color. customer-reported As opposed to development work item.
Projects
None yet
Development

No branches or pull requests

4 participants