Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rocket.Chat
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RocketChat
Rocket.Chat
Commits
df08bdc6
Commit
df08bdc6
authored
9 years ago
by
Gabriel Engel
Browse files
Options
Downloads
Patches
Plain Diff
fixed adding external scripts
parent
d1d6017f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/rocketchat-hubot/hubot.coffee
+16
-13
16 additions, 13 deletions
packages/rocketchat-hubot/hubot.coffee
with
16 additions
and
13 deletions
packages/rocketchat-hubot/hubot.coffee
+
16
−
13
View file @
df08bdc6
...
...
@@ -41,18 +41,6 @@ class Robot extends Hubot.Robot
error
:
(
callback
)
->
super
Meteor
.
bindEnvironment
(
callback
)
catchAll
:
(
callback
)
->
super
Meteor
.
bindEnvironment
(
callback
)
sendHelper
=
Meteor
.
bindEnvironment
(
robot
,
envelope
,
strings
,
map
)
->
while
strings
.
length
>
0
string
=
strings
.
shift
()
if
typeof
(
string
)
==
'function'
string
()
else
try
map
(
string
)
catch
err
console
.
error
"Hubot error:
#{
err
}
"
if
DEBUG
robot
.
logger
.
error
"RocketChat send error:
#{
err
}
"
class
RocketChatAdapter
extends
Hubot
.
Adapter
# Public: Raw method for sending data back to the chat source. Extend this.
#
...
...
@@ -142,12 +130,27 @@ class RocketBotReceiver
RocketBotUser
=
new
Hubot
.
User
(
message
.
u
.
username
,
rid
:
message
.
rid
)
RocketBotTextMessage
=
new
Hubot
.
TextMessage
(
RocketBotUser
,
message
.
msg
,
message
.
_id
)
RocketBot
.
adapter
.
receive
RocketBotTextMessage
console
.
log
RocketBot
;
console
.
log
'message: '
,
message
if
DEBUG
console
.
log
'RocketBot: '
,
RocketBot
if
DEBUG
return
message
sendHelper
=
Meteor
.
bindEnvironment
(
robot
,
envelope
,
strings
,
map
)
->
while
strings
.
length
>
0
string
=
strings
.
shift
()
if
typeof
(
string
)
==
'function'
string
()
else
try
map
(
string
)
catch
err
console
.
error
"Hubot error:
#{
err
}
"
if
DEBUG
robot
.
logger
.
error
"RocketChat send error:
#{
err
}
"
RocketBot
=
new
Robot
null
,
null
,
false
,
Meteor
.
settings
?
.
botname
?
'rocketbot'
RocketBot
.
alias
=
'bot'
RocketBot
.
adapter
=
new
RocketChatAdapter
RocketBot
HubotScripts
(
RocketBot
)
RocketChat
.
callbacks
.
add
'afterSaveMessage'
,
RocketBotReceiver
,
RocketChat
.
callbacks
.
priority
.
LOW
# Meteor.startup ->
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment