Beispiel #1
0
function login (token) {
  var body = querystring.stringify({
    token: token,
    agent: 'node-slack'
  })
  return request({
    url: 'https://api.slack.com/api/users.login',
    method: 'POST',
    headers: {
      'content-type': 'application/x-www-form-urlencoded',
      'content-length': body.length
    },
    body: body
  })
  .then(function (res) {
    var data = JSON.parse(res.body)
    return data
  })
}
Beispiel #2
0
function keepalive() {
  request(process.env.CHATBOT_URL + '/keepalive')
}