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
j.mosig
(Johannes Mosig)
July 30, 2019, 9:12am
2
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.
j.mosig
(Johannes Mosig)
July 31, 2019, 12:30pm
4
@erohmensing Do you have an idea?
Juste
(Juste)
August 1, 2019, 4:13pm
5
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
)
erohmensing
(Ella Rohm-Ensing)
August 5, 2019, 4:37pm
7
@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
erohmensing
(Ella Rohm-Ensing)
August 15, 2019, 7:58am
9
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
kmkamoto
(Kondwani Kamoto)
August 18, 2019, 3:52pm
10
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.
zaidalvi
(Zaidalvi)
February 5, 2020, 1:20pm
11
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.
erohmensing
(Ella Rohm-Ensing)
February 7, 2020, 1:09pm
12
@zaidalvi can you remove the entire slack_channel argument and try again? i.e.
slack:
slack_token: "xoxb-whatever"
as the entire endpoint configuration?
zaidalvi
(Zaidalvi)
February 7, 2020, 6:37pm
13
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.
zaidalvi
(Zaidalvi)
February 7, 2020, 8:01pm
14
I have also tried removing every thing else from my endpoints file as well. @erohmensing
liniribeiro
(Alini Ribeiro)
February 3, 2021, 9:54pm
15
I’m with the same problem, did you found the solution?