Skip to content

Commit 0863348

Browse files
author
Sean P. Kane
committed
Add support for rocketchat and other tweaks
1 parent 9704715 commit 0863348

File tree

5 files changed

+17
-6
lines changed

5 files changed

+17
-6
lines changed

bin/hubot-env

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ set -e
55
npm install
66
export PATH="node_modules/.bin:node_modules/hubot/node_modules/.bin:$PATH"
77

8-
exec node_modules/.bin/hubot --adapter ${HUBOT_ADAPTER} --alias ${HUBOT_ALIAS} --name ${HUBOT_NAME} "$@"
8+
exec node_modules/.bin/hubot --adapter ${HUBOT_ADAPTER} --alias "${HUBOT_ALIAS} " --name ${HUBOT_NAME} "$@"

compose.env

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@
22
STUDENT_ID=unknown
33
SLACK_TOKEN=unkown
44
HUB_USER=unknown
5-
5+
HUBOT_ADAPTER=slack
6+
ROCKETCHAT_URL=http://127.0.0.1:3000
7+
ROCKETCHAT_USER=hubot
8+
ROCKETCHAT_PASSWORD=unknown

docker-compose.yaml

+8-1
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,19 @@ services:
1212
EXPRESS_USER: "${STUDENT_ID}_bot"
1313
EXPRESS_PASSWORD: "${STUDENT_ID}_pw"
1414
PORT: "8080"
15-
HUBOT_ADAPTER: "slack"
15+
HUBOT_ADAPTER: "${HUBOT_ADAPTER}"
1616
HUBOT_ALIAS: "${STUDENT_ID}"
1717
HUBOT_NAME: "${STUDENT_ID}_bot"
1818
HUBOT_LOG_LEVEL: "debug"
1919
REDIS_URL: "redis://redis:6379"
2020
HUBOT_SLACK_TOKEN: "${SLACK_TOKEN}"
21+
RESPOND_TO_DM: "true"
22+
ROCKETCHAT_URL: "${ROCKETCHAT_URL}"
23+
ROCKETCHAT_ROOM: ""
24+
LISTEN_ON_ALL_PUBLIC: "true"
25+
ROCKETCHAT_USER: "${ROCKETCHAT_USER}"
26+
ROCKETCHAT_PASSWORD: "${ROCKETCHAT_PASSWORD}"
27+
ROCKETCHAT_AUTH: "password"
2128
ports:
2229
- "8080:8080"
2330
links:

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
"dependencies": {
88
"hubot": "^2.19.0",
99
"hubot-diagnostics": "^0.0.2",
10-
"hubot-help": "^0.2.2",
10+
"hubot-help": "^1.0.1",
1111
"hubot-redis-brain": "^1.0.0",
12+
"hubot-rocketchat": "^1.0.12",
1213
"hubot-scripts": "^2.17.2",
1314
"hubot-slack": "^4.4.0",
1415
"moment-timezone": "^0.5.13",

scripts/sid.coffee

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ module.exports = (robot) ->
2121
sidKey = parseInt(0)
2222

2323
robot.respond /sid reset ([0-9\.]+)/i, (msg) ->
24-
if robot.alias isnt "0"
24+
if robot.alias isnt "0" && robot.alias isnt "0 "
2525
msg.send "This is not the correct bot. Ensure you are in the instructor room and type '0 sid get'."
2626
else
2727
sidKey = parseInt(msg.match[1])
2828
msg.send "Student ID base reset to #{sidKey}"
2929

3030
robot.respond /sid get/i, (msg) ->
31-
if robot.alias isnt "0"
31+
if robot.alias isnt "0" && robot.alias isnt "0 "
3232
msg.send "This is not the correct bot. Ensure you are in the instructor room and type '0 sid get'."
3333
else
3434
sidKey = sidKey + 1

0 commit comments

Comments
 (0)