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
LABEL mantainer "Diego Dorgam <diego.dorgam@rocket.chat>"
ENV HUBOT_LANG='pt' \
ENV HUBOT_LANG='en' \
HUBOT_CORPUS='corpus.yml' \
HUBOT_ADAPTER=rocketchat \
HUBOT_OWNER=RocketChat \
......@@ -17,10 +17,9 @@ ENV HUBOT_LANG='pt' \
RESPOND_TO_DM=true \
RESPOND_TO_LIVECHAT=true \
RESPOND_TO_EDITED=true \
LISTEN_ON_ALL_PUBLIC=false \
HUBOT_NATURAL_DEBUG_MODE=false
LISTEN_ON_ALL_PUBLIC=true
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
USER node
......@@ -47,10 +46,18 @@ RUN yo hubot --adapter ${HUBOT_ADAPTER} \
--owner ${HUBOT_OWNER} \
--name ${HUBOT_NAME} \
--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/
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
export HUBOT_OWNER=RocketChat
export HUBOT_NAME='CatBot'
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_ROOM=j8pjQdHtZR5JnGF2S
export ROCKETCHAT_ROOM=GENERAL
export RESPOND_TO_DM=true
export RESPOND_TO_LIVECHAT=true
export ROCKETCHAT_USER=catbot
export ROCKETCHAT_PASSWORD='@cat!bot'
export ROCKETCHAT_PASSWORD='GatoNoTelhado'
export ROCKETCHAT_AUTH=password
export HUBOT_LOG_LEVEL=debug
export HUBOT_CORPUS='rocketenglish.yml'
export HUBOT_CORPUS='catbot-en.yml'
export HUBOT_LANG='en'
bin/hubot -a rocketchat
{
"name": "hubot-natural",
"version": "0.0.6",
"version": "0.0.7",
"private": true,
"author": "Diego Dorgam <diego.dorgam@rocket.chat>",
"description": "NLP YAML oriented chatbot",
"dependencies": {
"coffee-script": "^1.12.7",
"coffeescript": "^1.12.7",
"hubot": "^2.19.0",
"hubot-diagnostics": "0.0.1",
"hubot-help": "^0.2.2",
......
......@@ -248,6 +248,13 @@ module.exports = (_config, _configPath, robot) ->
msg = res.match[0].replace res.robot.name+' ', ''
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
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'))
......
......@@ -4,15 +4,7 @@ interactions:
# Greetings
- name: greeting-hi
expect:
- hey
- hi
- hi there
- heya
- hi bot
- Greetings
- hey bot
- hiii
- hey you
answer:
- Hi, $user.
- Just to let you know, I am a chatbot. I am trained to answer stuff
......@@ -32,6 +24,15 @@ interactions:
- hello bot
- what's up
- what's going on
- hey
- hi
- hi there
- heya
- hi bot
- Greetings
- hey bot
- hiii
- hey you
answer:
- |
Hello =), my name is CatBot, I'm an experimental ChatBot built in Rocket.Chat.
......@@ -55,8 +56,6 @@ interactions:
answer:
- I am great, $user. Everything is peaceful around here...
- 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
type: block
......@@ -203,10 +202,8 @@ interactions:
expect:
- are you a woman
- are you female
- are you a man
- are you male
- do you have gender
- do you have sex
- you make sex
- do you have a penis or vagina
answer:
- 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:
expect:
- "configure debug-"
- "set debug-"
- "let debug-"
- "turn debug-"
- "make debug-"
- "var debug-"
answer:
- $key changed to $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
event: configure
type: random
......@@ -346,11 +338,14 @@ interactions:
- "retrain bot"
- "reload training"
- "restart bot"
- "train again"
answer:
- reloading training..
- You got it $user
- Ok, just a moment
- Got it! Restarting engines...
- Right >>> Training reloaded
- You got it $user. Let's start again.
- Ok, just a moment... Fine we can start it over.
- Got it! Restarting engines... I'm finished training
- Training harder!
- Alright! No pain, no gain!
event: configure
type: random
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