Slack Integration, no response to events subscription

Hello !

I just installed botpress on windows and and I just wanted to try to connect a bot to slack. I tried the slack integration with the welcome-bot following this tutorial : https://botpress.com/docs/channels/slack

I created a https link with ngrok and set it up on the externalUrl field in botpress.config.json, I enabled the channel-slack module in “data/global/config/channel-slack.json” and put in the SigningSecret from my Slack app. I restarted the bp and slack channel seems to be enabled.

But then when I go to the Events subscription page of my slack app to configure callback setting up the request URL like this : https://5723d863b41e.ngrok.io/api/v1/bots/welcome-bot/mod/channel-slack/bots/welcome-bot/events-callback as showed in the docs, it doesn’t respond :

on Ngrok :

debug log : ( I also tried with “/api/v1/bots/welcome-bot/mod/channel-slack/bots/welcome-bot/events-callback”

Is there something I’m missing ?

Thank you

2 Likes

Hey @Macalli

I managed to get a response from my bot:

Here’s how I got it working:

1 - I set the externalUrl to http://localhost:3000 and enabled the module channel-slack in YOUR_BP_INSTALL/data/global/botpress.config.json
2 - I started an instance of ngrok.
3 - (This step is pretty obscur) : I copied file YOUR_BP_INSTALL/data/global/config/channel-slack.json and pasted it in YOUR_BP_INSTALL/data/bots/YOUR_BOT/config/channel-slack.json
4 - I set enable: true in this config file (the one in your bot directory)
5 - I set the botToken to my client Id and signingSecret field to my signing secret.
6 - I pasted the following URL in slack http challenge input bot: YOUR_NGROK_HTTPS_ENDPOINT/api/v1/bots/YOUR_BOT/mod/channel-slack/bots/YOUR_BOT/callback

This should help you make your bot work.

I’ve gotta say, this is the first time I set up a bot for Slack and the experience is really painfull. Because I know the code quite well, I had to debug my way with breakpoints just to understand whats going on…

I’ll talk about this to the dev team and see if we can make it better in a near futur.

In the mean time, feel free to post again on this forum if you have any question!

Thanks for your contribution to the forum,

François

3 Likes

Thanks a lot ! It worked :slight_smile:

Just a detail, but in this case, the request URL should be :

YOUR_NGROK_HTTPS_ENDPOINT/api/v1/bots/YOUR_BOT/mod/channel-slack/bots/YOUR_BOT/events-callback

2 Likes

I use Botpress 12.22.0 and for the Events Subscription I needed to set the URL in this way:

https://<your_external_url>/api/v1/bots/<bot_name>/mod/channel-slack/bots/<bot_name>/events-callback

and for the interactive endpoint:
https://<your_external_url>/api/v1/bots/<bot_name>/mod/channel-slack/bots/<bot_name>/callback

1 Like

Sorry for the necromancy but I’m experiencing the same problem. I’ve tried v12.22.0 and v12.23.0 and I’ve tried both;

  • https://<your_external_url>/api/v1/bots/<bot_name>/mod/channel-slack/bots/<bot_name>/events-callback
  • https://<your_external_url>/api/v1/bots/<bot_name>/mod/channel-slack/events-callback

I tried @frank_levasseur steps. I’m running

  botpress:
    image: botpress/server:v12_23_0
    volumes:
      - botpress_data:/botpress/data
    environment:
      - VIRTUAL_HOST=<your_external_url>
      - VIRTUAL_PORT=3000
      - LETSENCRYPT_HOST=<your_external_url>
      - LETSENCRYPT_EMAIL=<your_email_address>
      - VERBOSITY_LEVEL=2
      - DEBUG=bp:*
    restart: always

with jrcs/letsencrypt-nginx-proxy-companion and jwilder/nginx-proxy