Skip to content
Snippets Groups Projects
Commit e7266b73 authored by Diego Dorgam's avatar Diego Dorgam
Browse files

Closes #24

parent 7f7a9b5d
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ FROM node:alpine ...@@ -2,7 +2,7 @@ FROM node:alpine
LABEL mantainer "Diego Dorgam <diego.dorgam@rocket.chat>" LABEL mantainer "Diego Dorgam <diego.dorgam@rocket.chat>"
ENV HUBOT_LANG='pt' \ ENV HUBOT_LANG='en' \
HUBOT_CORPUS='corpus.yml' \ HUBOT_CORPUS='corpus.yml' \
HUBOT_ADAPTER=rocketchat \ HUBOT_ADAPTER=rocketchat \
HUBOT_OWNER=RocketChat \ HUBOT_OWNER=RocketChat \
...@@ -17,10 +17,9 @@ ENV HUBOT_LANG='pt' \ ...@@ -17,10 +17,9 @@ ENV HUBOT_LANG='pt' \
RESPOND_TO_DM=true \ RESPOND_TO_DM=true \
RESPOND_TO_LIVECHAT=true \ RESPOND_TO_LIVECHAT=true \
RESPOND_TO_EDITED=true \ RESPOND_TO_EDITED=true \
LISTEN_ON_ALL_PUBLIC=false \ LISTEN_ON_ALL_PUBLIC=true
HUBOT_NATURAL_DEBUG_MODE=false
RUN apk --update add --no-cache git python make g++ && \ RUN apk --update add --no-cache git && \
addgroup -S hubotnat && adduser -S -g hubotnat hubotnat addgroup -S hubotnat && adduser -S -g hubotnat hubotnat
USER node USER node
...@@ -47,10 +46,18 @@ RUN yo hubot --adapter ${HUBOT_ADAPTER} \ ...@@ -47,10 +46,18 @@ RUN yo hubot --adapter ${HUBOT_ADAPTER} \
--owner ${HUBOT_OWNER} \ --owner ${HUBOT_OWNER} \
--name ${HUBOT_NAME} \ --name ${HUBOT_NAME} \
--description ${HUBOT_DESCRIPTION} \ --description ${HUBOT_DESCRIPTION} \
--defaults --no-insight --defaults --no-insight && \
rm /home/hubotnat/bot/external-scripts.json \
/home/hubotnat/bot/scripts/example.coffee \
/home/hubotnat/bot/hubot-scripts.json
COPY ["external-scripts.json","package.json", "/home/hubotnat/bot/"]
COPY ["package.json", "/home/hubotnat/bot/"]
ADD scripts/ /home/hubotnat/bot/scripts/ ADD scripts/ /home/hubotnat/bot/scripts/
ENTRYPOINT /home/hubotnat/bot/bin/hubot -a rocketchat ENTRYPOINT /home/hubotnat/bot/bin/hubot -a rocketchat
USER root
RUN apk del git && \
rm -rf /var/cache/apk/*
...@@ -3,17 +3,14 @@ export HUBOT_ADAPTER=rocketchat ...@@ -3,17 +3,14 @@ export HUBOT_ADAPTER=rocketchat
export HUBOT_OWNER=RocketChat export HUBOT_OWNER=RocketChat
export HUBOT_NAME='CatBot' export HUBOT_NAME='CatBot'
export HUBOT_DESCRIPTION="Processamento de linguagem natural com hubot" export HUBOT_DESCRIPTION="Processamento de linguagem natural com hubot"
#export ROCKETCHAT_URL=https://demo.rocket.chat
#export ROCKETCHAT_URL=http://localhost:3000
export ROCKETCHAT_URL=https://chat.dorgam.it export ROCKETCHAT_URL=https://chat.dorgam.it
#export ROCKETCHAT_ROOM=j8pjQdHtZR5JnGF2S
export ROCKETCHAT_ROOM=GENERAL export ROCKETCHAT_ROOM=GENERAL
export RESPOND_TO_DM=true export RESPOND_TO_DM=true
export RESPOND_TO_LIVECHAT=true export RESPOND_TO_LIVECHAT=true
export ROCKETCHAT_USER=catbot export ROCKETCHAT_USER=catbot
export ROCKETCHAT_PASSWORD='@cat!bot' export ROCKETCHAT_PASSWORD='GatoNoTelhado'
export ROCKETCHAT_AUTH=password export ROCKETCHAT_AUTH=password
export HUBOT_LOG_LEVEL=debug export HUBOT_LOG_LEVEL=debug
export HUBOT_CORPUS='rocketenglish.yml' export HUBOT_CORPUS='catbot-en.yml'
export HUBOT_LANG='en' export HUBOT_LANG='en'
bin/hubot -a rocketchat bin/hubot -a rocketchat
{ {
"name": "hubot-natural", "name": "hubot-natural",
"version": "0.0.6", "version": "0.0.7",
"private": true, "private": true,
"author": "Diego Dorgam <diego.dorgam@rocket.chat>", "author": "Diego Dorgam <diego.dorgam@rocket.chat>",
"description": "NLP YAML oriented chatbot", "description": "NLP YAML oriented chatbot",
"dependencies": { "dependencies": {
"coffee-script": "^1.12.7", "coffeescript": "^1.12.7",
"hubot": "^2.19.0", "hubot": "^2.19.0",
"hubot-diagnostics": "0.0.1", "hubot-diagnostics": "0.0.1",
"hubot-help": "^0.2.2", "hubot-help": "^0.2.2",
......
...@@ -248,6 +248,13 @@ module.exports = (_config, _configPath, robot) -> ...@@ -248,6 +248,13 @@ module.exports = (_config, _configPath, robot) ->
msg = res.match[0].replace res.robot.name+' ', '' msg = res.match[0].replace res.robot.name+' ', ''
msg = msg.replace(/^\s+/, '') msg = msg.replace(/^\s+/, '')
msg = msg.replace(/\s+&/, '') msg = msg.replace(/\s+&/, '')
# console.log '\n\n'
# console.log JSON.stringify(res.robot)
# console.log '\n\n'
console.log JSON.stringify(res.message)
console.log '\n\n'
console.log JSON.stringify(res.envelope)
console.log '\n\n'
# check if robot should respond # check if robot should respond
if res.envelope.user.roomType in ['c','p'] if res.envelope.user.roomType in ['c','p']
if (res.message.text.match new RegExp('\\b' + res.robot.name + '\\b', 'i')) or (res.message.text.match new RegExp('\\b' + res.robot.alias + '\\b', 'i')) if (res.message.text.match new RegExp('\\b' + res.robot.name + '\\b', 'i')) or (res.message.text.match new RegExp('\\b' + res.robot.alias + '\\b', 'i'))
......
...@@ -4,15 +4,7 @@ interactions: ...@@ -4,15 +4,7 @@ interactions:
# Greetings # Greetings
- name: greeting-hi - name: greeting-hi
expect: expect:
- hey
- hi
- hi there
- heya
- hi bot
- Greetings
- hey bot
- hiii
- hey you
answer: answer:
- Hi, $user. - Hi, $user.
- Just to let you know, I am a chatbot. I am trained to answer stuff - Just to let you know, I am a chatbot. I am trained to answer stuff
...@@ -32,6 +24,15 @@ interactions: ...@@ -32,6 +24,15 @@ interactions:
- hello bot - hello bot
- what's up - what's up
- what's going on - what's going on
- hey
- hi
- hi there
- heya
- hi bot
- Greetings
- hey bot
- hiii
- hey you
answer: answer:
- | - |
Hello =), my name is CatBot, I'm an experimental ChatBot built in Rocket.Chat. Hello =), my name is CatBot, I'm an experimental ChatBot built in Rocket.Chat.
...@@ -55,8 +56,6 @@ interactions: ...@@ -55,8 +56,6 @@ interactions:
answer: answer:
- I am great, $user. Everything is peaceful around here... - I am great, $user. Everything is peaceful around here...
- How can I be useful to you? - How can I be useful to you?
- Is there something you'd like to know about Rocket.Chat, support, installation, OpenSource movement maybe?
- pode perguntar a vontade
event: respond event: respond
type: block type: block
...@@ -203,10 +202,8 @@ interactions: ...@@ -203,10 +202,8 @@ interactions:
expect: expect:
- are you a woman - are you a woman
- are you female - are you female
- are you a man
- are you male
- do you have gender - do you have gender
- do you have sex - you make sex
- do you have a penis or vagina - do you have a penis or vagina
answer: answer:
- I don't have gender, I am just like an angel, a assexual being, way beyond your form of existance - I don't have gender, I am just like an angel, a assexual being, way beyond your form of existance
...@@ -326,15 +323,10 @@ interactions: ...@@ -326,15 +323,10 @@ interactions:
expect: expect:
- "configure debug-" - "configure debug-"
- "set debug-" - "set debug-"
- "let debug-"
- "turn debug-"
- "make debug-"
- "var debug-" - "var debug-"
answer: answer:
- $key changed to $value! - $key changed to $value!
- Got it! Now $key is $value - Got it! Now $key is $value
- Sure thing! $key is set to $value
- blip blip =] $key equals $value
- $key = $value -> https://media.giphy.com/media/12NUbkX6p4xOO4/giphy.gif - $key = $value -> https://media.giphy.com/media/12NUbkX6p4xOO4/giphy.gif
event: configure event: configure
type: random type: random
...@@ -346,11 +338,14 @@ interactions: ...@@ -346,11 +338,14 @@ interactions:
- "retrain bot" - "retrain bot"
- "reload training" - "reload training"
- "restart bot" - "restart bot"
- "train again"
answer: answer:
- reloading training.. - Right >>> Training reloaded
- You got it $user - You got it $user. Let's start again.
- Ok, just a moment - Ok, just a moment... Fine we can start it over.
- Got it! Restarting engines... - Got it! Restarting engines... I'm finished training
- Training harder!
- Alright! No pain, no gain!
event: configure event: configure
type: random type: random
action: train action: train
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment