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 @@ -73,9 +73,19 @@ class IrcBot extends Adapter
73
73
command : (command , strings ... ) ->
74
74
@bot .send command, strings...
75
75
76
+ checkCanStart : ->
77
+ if not process .env .HUBOT_IRC_NICK or @robot .name
78
+ throw new Error (" HUBOT_IRC_NICK is not defined; try: export HUBOT_IRC_NICK='mybot'" )
79
+ else if not process .env .HUBOT_IRC_ROOMS
80
+ throw new Error (" HUBOT_IRC_ROOMS is not defined; try: export HUBOT_IRC_ROOMS='#myroom'" )
81
+ else if not process .env .HUBOT_IRC_SERVER
82
+ throw new Error (" HUBOT_IRC_SERVER is not defined: try: export HUBOT_IRC_SERVER='irc.myserver.com'" )
83
+
76
84
run : ->
77
85
self = @
78
86
87
+ do @checkCanStart
88
+
79
89
options =
80
90
nick : process .env .HUBOT_IRC_NICK or @robot .name
81
91
port : process .env .HUBOT_IRC_PORT
You can’t perform that action at this time.
0 commit comments