Skip to content

Commit

Permalink
JS documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
philliphenslee committed Oct 23, 2015
1 parent e03eb4e commit af5377b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
7 changes: 3 additions & 4 deletions lib/slack/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ var _ = require('lodash');
var bole = require('bole');
var https = require('https');
var qs = require('querystring');
var util = require('util');

var errors = require('../errors');
var cache = require('../cache');
Expand All @@ -13,7 +12,7 @@ var log = bole('slack.api');
/**
* Makes a method call to the Slack API
* @param {string} method The method to call
* @param {object} params The additional message options
* @param {object} args The additional message options
* @param {function} callback(err,result)
*/
function post(method, args, callback) {
Expand Down Expand Up @@ -76,9 +75,9 @@ function post(method, args, callback) {
});
});

request.on('error', function (err) {
request.on('error', function(err) {
log.debug(err);
callback(err);
return callback(err);
});

request.write(postData);
Expand Down
18 changes: 9 additions & 9 deletions lib/slack/channels.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var slackTypes = require('./types');
/**
* Gets a channel object from the local cache
* @param {string} match The channel id or name
* @callback {function} callback(err,result)
* @param {function} callback(err,result)
*/
function getChannel(match, callback) {

Expand All @@ -31,7 +31,7 @@ function getChannel(match, callback) {
/**
* Gets the last message posted to a channel
* @param {string} channel The channel id
* @callback {function} callback(err,result)
* @param {function} callback(err,result)
*/
function getLastChannelMessage(channel, callback) {

Expand Down Expand Up @@ -59,8 +59,8 @@ function getLastChannelMessage(channel, callback) {
/**
* Gets the channels history
* @param {string} channel The channel id
* @param {object} options additonal method arguments
* @callback {function} callback(err,result)
* @param {object} args The additional method arguments
* @param {function} callback(err,result)
*/
function getHistory(channel, args, callback) {

Expand Down Expand Up @@ -90,7 +90,7 @@ function getHistory(channel, args, callback) {
/**
* Gets the channels information from the api
* @param {string} channel The channel id
* @callback {function} callback(err,result)
* @param {function} callback(err,result)
*/
function getInfo(channel, callback) {

Expand All @@ -115,7 +115,7 @@ function getInfo(channel, callback) {
};
/**
* Gets channel list from API, excluding archived channels
* @callback {function} callback(err,result)
* @param {function} callback(err,result)
*/
function getList(callback) {

Expand All @@ -133,7 +133,7 @@ function getList(callback) {
* Moves the read cursor in a channel.
* @param {string} channel The channel id
* @param {string} timestamp Time of most recently seen message
* @callback {function} callback(err,result)
* @param {function} callback(err,result)
*/
function mark(channel, timestamp, callback) {

Expand All @@ -153,7 +153,7 @@ function mark(channel, timestamp, callback) {
* Set the channels's purpose
* @param {string} channel The channel id
* @param {string} purpose The new channel purpose
* @callback {function} callback(err,result)
* @param {function} callback(err,result)
*/
function setPurpose(channel, purpose, callback) {

Expand All @@ -173,7 +173,7 @@ function setPurpose(channel, purpose, callback) {
* Set the channel's topic
* @param {string} channel The channel id
* @param {string} topic The new channel topic
* @callback {function} callback(err,result)
* @param {function} callback(err,result)
*/
function setTopic(channel, topic, callback) {

Expand Down

0 comments on commit af5377b

Please sign in to comment.