Botpress and Slack

Hey Peeps!

Our bot works perfectly with Messenger. When we’re trying to set it up on Slack, we’re receiving the following errors.


In addition to the errors I’ve attached the config file of the bot. !

Screenshot 2021-10-25 at 13.39.22|690x201

The guide I’m using is : Slack · | Developer's Guide. We’ve tried both new Slack app and classic Slack app methods.

Can we get any suggestions ?

Regards,

Kris

Hi Kris, welcome to the Botpress forums!

From the logs you provided, it looks like the request URL is set to /bot_id/slack/events. Looking at the documentation, the URL should be instead /bot_id/slack/interactive.

Hope that helps!

Hey Gordon,

Thank you for the feedback!

Correct this is done on step 1 and 3 and it goest through.

  1. Open the page Features > Interactivity & Shortcuts , then turn the Interactivity switch to On
  2. Set the request URL to: <EXTERNAL_URL>/api/v1/messaging/webhooks/<YOUR_BOT_ID>/slack/interactive

We’re experiencing the issue at steps

  1. Back on the your Slack app’s page, open the page Features > Event Subscriptions , then turn the Enable Events switch to On
  2. Set the Request URL to: <EXTERNAL_URL>/api/v1/messaging/webhooks/<YOUR_BOT_ID>/slack/events
  • Replace EXTERNAL_URL by the value of externalUrl in your botpress.config.json
  • Replace YOUR_BOT_ID with your bot ID

On the other hand I’m able to integrate the bot now is What’s App and my website so it’s not from the bot. I think it may be Slack.

Hi Kris,

I took a look at the Slack documentation, and it looks like it is failing to authenticate the URL. Slack will send a POST request to the URL to validate it, and they’re very specific about how they want that request handled. You can respond to the challenge with plaintext or json as required in the documentation. You might need to look into how the events webhook is responding to this. Unfortunately I can’t tell you the exact location to find this, but your channel-slack.config.json might be a good place to start.

Hope this helps!

Thank you Gordon!
I got in touch with Slack support and I will look into the issue as it seems it’s coming from their end.

@kdgeorgiev check my post at the end of this thread https://forum.botpress.com/t/slack-integration-no-response-to-events-subscription/4659/5, maybe this will help you

Hey Frank,
I’m about to check it.

Regards,

Kris

@FrankDaze - Hey Frank!
No luck with your suggestion. I’m using NGINX and it seems I’m unable to make it work. It’s weird that only Slack has this issue with BotPress.

Hie @kdgeorgiev, welcome to the Botpress society.

Due to the high number of forum posts with Slack-related problems, we will be creating content on Slack integration. I will update here as this content becomes available. I reckon a follow along video or dedicated blog post will help you identify your errors faster.

Hey Michale!

Thank you. At this point Slack integration with our bot is not our top priority. I’ve left out this error and integration for at least two weeks.
Once my team is done with the main project I will spent a week to look into the issue and why that’s happening. I’m assuming is Slack and NGinx are not very compatible and friendly to each other.

Thank you!

Hey @kdgeorgiev
Your bot is working fine with messenger and not with slack is because you’ve added slack credentials outside the “channels” scope. (from your 2nd screenshot)


just shift slack creds to right after where messenger ends

"messaging": {
   "channels": {
      "messenger": {
        "enabled": true,
        "accessToken": "your_access_token",
        "appSecret": "your_app_secret",
        "verifyToken": "your_verify_token"
      },
      "slack": {
        "enabled": true,
        "signingSecret": "your_signing_secret",
        "useRTM": false,
        "botToken": "your_bot_token"
      }
    }
  }
1 Like

Thank you Rohan!

I shall try it later today. I did not see it.

Regards,

Kris

Closing thread!
Thank you. Everything is now working. I can’t realise why I’ve missed it.