Closed angegar closed 6 years ago
I'm really new to bots too. These are more or less the steps I took to make this work using Docker:
version: '3'
volumes:
redis_data_vol:
external: false
services:
redis:
image: redis:alpine
volumes:
- redis_data_vol:/data
stdin_open: true
networks:
overlay:
aliases:
- redis
hubot:
build:
context: ./
depends_on:
- redis
volumes:
- ./scripts:/code/scripts
ports:
- 8080:8080
stdin_open: true
networks:
overlay:
aliases:
- hubot
environment:
HUBOT_LOG_LEVEL: debug
HUBOT_ADAPTER: botframework
BOTBUILDER_APP_ID: <<REPLACE_ME>>
BOTBUILDER_APP_PASSWORD: <<REPLACE_ME>>
REDIS_URL: redis://redis:6379/hubot
REDISTOGO_URL: redis://redis:6379
ngrok:
# depends_on:
# - hubot
image: wernight/ngrok
ports:
- 4040:4040
networks:
overlay:
environment:
NGROK_PORT: hubot:8080
NGROK_AUTH: <<REPLACE_ME>>
networks:
overlay:
driver: bridge
Replace the ngrok environments with your keys.
Run ngrok detached (if you restart the ngrok container, your URL will change)
docker-compose up -d ngrok
If ngrok has run successfully, go to your ngrok dashboard and copy the HTTPS URL.
Log-in to Azure and create a new Bot Service (Bot Channels Registration). on the Messaging Endpoint
use the URL you copied plus api/messages
. It should look like this: https://foobar.ngrok.io/api/messages
From Azure you should be redirected to register a Microsoft Application, there you'll get the BOTBUILDER_APP_ID
and BOTBUILDER_APP_PASSWORD
. Replace those on the docker-compose.
Run hubot using docker-compose up hubot
, you can test it from within Azure using the Test in Web Chat option of your Bot Service.
Hope this helps to get you started.
@leonardochaia thank you for your answer, i will see if i can reuse some piece. For now i think my issue is more related with my nginx ingress controller than with the way i configure hubot.
@angegar you can also use the yeoman generator to build a sample with hubot. For adapter specify 'botframework'
The hubot docs have more info on this https://hubot.github.com/docs/
Thank you i finally managed to make it works, i believed that i have to implement the api/messages endpoint when it is made by the adapter. :)
Hi, I am completly noob in bot and i am struggling to make it works. Can you please add a basic sample in your documentation.
My understanding is that we just need to create a hubot script as documented by hubot containing an endpoint (/api/messages) which will handle the communication with botframework. Thus if i create a bot with the following code :
robot.router.post('/api/messages', function(req,resp){ data = req.body resp.send(data) }
it should work. however in using the test feature in dev.botframework.com i can't send any messages to my bot.
Any help will be great.
++