Rasa bot not responding on slack

Hi, i developed a simple chat bot using rasa and i integrated it to slack using ngrok.

i trained my bot, then i started my actions server and then i started ngrok server and then i ran my run_app.py file which handle_channels.

In my slack, i used the url given by ngrok and in event subscriptions under Request URL it shows my url is Verified.

This is my channel handle code

agent.handle_channels([input_channel], http_port=5004)

My app name in slack is samplebot. When i talk to my bot, it wont reply anything. But my ngrok console shows me POST /webhooks/slack/webhook 200 OK status

Is it possible that your bot is predicting action_listen? Does it respond to exactly the same user input locally?

@j.mosig yeah, it works fine locally.

Do i need to add await in the beginning of the agent.handle

Btw i tried to run await agent.handle_text("hi") to make sure if the agent is working and it gives me that await is not a valid syntax.

@erohmensing Do you have an idea?

Hi @dushandevinda. Did you subscribe your bot to any events on slack configuration page?

@Juste yes, i did subscribe to those events. ( message.channel , message.groups , message.im and message.mpim)

@dushandevinda can i ask why you are running slack in custom python code instead of via

rasa run --connector slack --port 5004

i was watching a tutorial and thats why i made that custom python code. Anyways, thanks a lot for the time you guys took to reply me. I made my own ui and i used rasa webhooks to work with my UI and now its working fine. Thanks a lot @erohmensing

No worries @dushandevinda. Things move fast here at Rasa and a lot of video tutorials are outdated. Glad you got it working – super cool that you used your own UI!

1 Like

I am also struggling to get a response from Slack even though ngrok displays POST /webhooks/slack/webhook 200 OK

Is there a way to debug the response from Slack?

Everything works fine when I use rasa shell

This is the output from debugging. Rasa seems to processing the message sent via Slack but the message doesn’t seem to return a reponse.

Hi @kmkamoto. Did you figure out where it went wrong? I have the same error as you at the moment. I have just using the basic rasa init bot.

@zaidalvi can you remove the entire slack_channel argument and try again? i.e.

  slack_token: "xoxb-whatever"

as the entire endpoint configuration?

Hi @erohmensing thank you for taking out the time to help. So I tried removing the slack channel from the endpoint credentials file but the issue is still the same. For an overview I use the command:

  • rasa run which gives me the following:

  • I run ngrok on 5005 which gives me this:

  • I use the “http” link from that server and provide that in my endpoint file:

  • The I run the server again in a new terminal (without closing either two previous ones) on the port 5002 using the following command:

    => rasa run --port 5002 --connector slack --credentials credentials.yml --endpoints endpoints.yml --log-file out.log --cors * --enable-api --debug -m models

which gives me this:

My Event Subscriptions are these:

Scopes in OAuth&Permissions:

Incoming Webhooks are disabled:

When I talk to my bot on Slack this is the output:

My messages to my bot on slack:

I don’t understand why this happening.

I have also tried removing every thing else from my endpoints file as well. @erohmensing

I’m with the same problem, did you found the solution?