Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
{TextMessage} = require '../node_modules/hubot/src/message'
module.exports = (robot) -> '/hubot/bearychat/:room', (req, res) ->
data = if req.body.payload? then JSON.parse req.body.payload else req.body
robot._send ?= robot.adapter.send;
robot.adapter.send = (user,strings...) ->
res.send {text: strings.toString()} if is "http"
robot.adapter.send = robot._send if isnt "http"
user = robot.brain.userForId '1', name: 'http', room: 'http'
robot.receive new TextMessage user, data.text, 'messageId'

This comment has been minimized.


This comment has been minimized.

Copy link

@yuanbohan yuanbohan commented Sep 8, 2015

你好,不过 BearyChat 的中文名是倍洽,而不是 简聊。 简聊的地址是 这里

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.