Skip to content

Commit

Permalink
Merge pull request #94 from RocketChat/geekgonecrazy-customMessage
Browse files Browse the repository at this point in the history
Allow Rich Messages
  • Loading branch information
Sing-Li committed Jan 23, 2016
2 parents 60875c4 + 63764fc commit a440041
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/rocketchat.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,15 @@ class RocketChatBotAdapter extends Adapter
)

send: (envelope, strings...) =>
@chatdriver.sendMessage(str, envelope.room) for str in strings
@chatdriver.sendMessage(str, envelope.room) for str in strings

customMessage: (data) =>
@chatdriver.customMessage(data)

reply: (envelope, strings...) =>
@robot.logger.info "reply"
strings = strings.map (s) -> "@#{envelope.user.name} #{s}"
@send envelope, strings...
@robot.logger.info "reply"
strings = strings.map (s) -> "@#{envelope.user.name} #{s}"
@send envelope, strings...

callMethod: (method, args...) =>
@chatdriver.callMethod(method, args)
Expand Down
5 changes: 5 additions & 0 deletions src/rocketchat_driver.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ class RocketChatDriver
@logger.info "Sending Message To Room: #{roomid}"

@asteroid.call('sendMessage', {msg: text, rid: roomid})

customMessage: (message) =>
@logger.info "Sending Custom Message To Room: #{message.channel}"

@asteroid.call('sendMessage', {msg: "", rid: message.channel, attachments: message.attachments, bot: true, groupable: false})

login: (username, password) =>
@logger.info "Logging In"
Expand Down

0 comments on commit a440041

Please sign in to comment.