File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ class XmppBot extends Adapter
2121 String :: startsWith ?= (s ) -> @ slice (0 , s .length ) == s
2222
2323 run : ->
24+ do @checkCanStart
25+
2426 options =
2527 username : process .env .HUBOT_XMPP_USERNAME
2628 password : ' ********'
@@ -441,5 +443,13 @@ class XmppBot extends Adapter
441443 offline : =>
442444 @robot .logger .debug " Received offline event"
443445
446+ checkCanStart : =>
447+ if not process .env .HUBOT_XMPP_USERNAME
448+ throw new Error (" HUBOT_XMPP_USERNAME is not defined; try: export HUBOT_XMPP_USERNAME='user@xmpp.service'" )
449+ else if not process .env .HUBOT_XMPP_PASSWORD
450+ throw new Error (" HUBOT_XMPP_PASSWORD is not defined; try: export HUBOT_XMPP_PASSWORD='password'" )
451+ else if not process .env .HUBOT_XMPP_ROOMS
452+ throw new Error (" HUBOT_XMPP_ROOMS is not defined: try: export HUBOT_XMPP_ROOMS='room@conference.xmpp.service'" )
453+
444454exports .use = (robot ) ->
445455 new XmppBot robot
You can’t perform that action at this time.
0 commit comments