I followed the MS documentation on how to configure a Slack channnel for a bot. But I believe it is outdated because it talks about dev.botframework.com configuration and not from the Azure portal. Interestingly enough the URL slack.botframework.com for configuring the api still works. But the issue is that even debugging my bot locally with ngrok, the only message that reaches the bot is one when I try to authorize the channel in slack, after that when I write a message it doesn't reach the bot.
问题:
回答1:
That doc is outdated, to some extent. The portion UP TO connecting your Slack App to Bot Framework is correct, however, there are both difference and addtional steps that must be taken from that point.
As you're aware, the bot must be created in the Azure Portal. AFTER the step that instructs you to create a Bot User on the Slack API page, go ahead and swap over to Azure and create your bot. For assistance on how to do that, you can follow Create A Bot with Bot Service
Once your bot is created and deployed successfully, click over to the Bot Management Setting blade. You're going to need your bot handle, and YES it is case sensitive. That is what you're going to use for your 'Subscribe to Bot Events' Request URL.
From there, you can go ahead and follow the 'Subscribe to Bot Events', 'Add and Configure Interactive Messages (optional)', and 'Gather credentials' sections of the tutorial as is.
Next, head back to Azure Portal and your bot there. Click the Channels under Bot Management (link above settings), scroll to the bottom, and select Slack. THAT is where you're going to put your Slack credentials. Once you push save, a new window will open, asking you to Authorize your bot. Go ahead and click 'Authorize'.
The Tutorial ends there, however, there are a few small steps that still need to be taken. Go back to the Slack App and click 'Basic Information'. On the main screen, there is a list of checked steps under the heading 'Building Apps for Slack' Click on the one that says 'Install your app to your workspace' (1), then click the button that says 'Install App to Workspace'(2)
Once more, a new window will pop up, asking for authorization. Again, select 'Authorize'
After that, wait a few minutes for Slack to finalize the authorization on their end (I've had a bot take 5 min to authorize the connection). Then, you can go back into the Slack workspace, and either directly message your bot or add them to a channel and test.