简体   繁体   English

Slack 交互式消息未在我的机器人上触发 Post 请求

[英]Slack interactive message not triggering Post request on my bot

I'm working on a bot using the Microsoft Bot Framework.我正在使用 Microsoft Bot Framework 开发机器人。 I'm trying to get it up and running on Slack, and got blocked by an issue regarding interactive buttons.我正在尝试在 Slack 上启动并运行它,但被有关交互式按钮的问题所阻止。 In a waterfall dialog flow, I'm creating a choice prompt like below在瀑布对话流中,我正在创建一个选择提示,如下所示

    private async Task<DialogTurnResult> IdentifyUserTypeAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken)
    {
        var message = "Please select what kind of user you are"

        userTypes = await userTypeRepository.GetAllUserTypesAsync();
        var options = new PromptOptions
        {
            Prompt = MessageFactory.Text(message),
            Choices = ChoiceFactory.ToChoices(userTypes.Select(x => x.UserType.ToString()).ToList()),
            Style = ListStyle.HeroCard,
        };

        await state.ConversationState.SaveChangesAsync(stepContext.Context);
        return await stepContext.PromptAsync(UserTypeDialogId, options);
    }

On the Slack app, the buttons renders correctly, like in the image below.在 Slack 应用程序上,按钮正确呈现,如下图所示。

松弛按钮

However, when I click the buttons, nothing happens.但是,当我单击按钮时,什么也没有发生。 I see the request on my local slack client actually calls my slack app, and returns with a 200.我看到本地 slack 客户端上的请求实际上调用了我的 slack 应用程序,并返回 200。

I have followed this tutorial on setting up the Slack app using ABS: https://docs.microsoft.com/en-us/azure/bot-service/bot-service-channel-connect-slack?view=azure-bot-service-4.0&tabs=abs我已按照本教程使用 ABS 设置 Slack 应用程序: https://docs.microsoft.com/en-us/azure/bot-service/bot-service-channel-connect-slack?view=azure-bot-服务 4.0&tabs=abs

On the slack app I have the following configurations在 slack 应用程序上,我有以下配置

Redirect URL:重定向 URL:

重定向网址

Scopes:范围:

范围

Events are enabled, and I have added the request URL.事件已启用,我添加了请求 URL。 The black part is my bot handle, taken from ABS黑色部分是我的机器人句柄,取自 ABS

活动

I have subscribed the following Bot events我已订阅以下 Bot 事件

机器人事件

The bot is configured to be always online:机器人配置为始终在线:

总是在线

And lastly, I have enabled interactivity, and added the request URL, which seemed to be validated correctly by the Slack app.最后,我启用了交互性,并添加了请求 URL,这似乎已被 Slack 应用程序正确验证。

交互性

Am I missing something?我错过了什么吗? I have tried to start over multiple times, but I end up in the same situation, where the button doesn't seem to fire anything on my bot code.我曾多次尝试重新开始,但最终遇到了同样的情况,按钮似乎没有在我的机器人代码上触发任何东西。 There's simply no incomming request to the Bot's webserver. Bot 的网络服务器根本没有传入请求。

A fix is on the way.修复正在进行中。 In the meantime, there are two workarounds you can try.同时,您可以尝试两种解决方法。 You can create a classic Slack app , or you can bypass the ABS Slack connector by using the Slack adapter instead.您可以创建经典的 Slack 应用程序,也可以使用 Slack 适配器绕过 ABS Slack 连接器。

You can see a discussion of this here: https://github.com/microsoft/BotBuilder-Samples/issues/2553你可以在这里看到一个讨论: https://github.com/microsoft/BotBuilder-Samples/issues/2553

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM