Added get channel logs

This commit is contained in:
hydrabolt
2015-10-31 23:58:47 +00:00
parent 3c16a9f2a4
commit 53ef5df10d
6 changed files with 154 additions and 6 deletions

View File

@@ -171,6 +171,29 @@ class Client extends EventEmitter {
});
}
// def getChannelLogs
getChannelLogs(where, limit=500, options={}, callback=function(err, logs){}){
var self = this;
return new Promise((resolve, reject) => {
if (typeof options === "function") {
// options is the callback
callback = options;
}
self.internal.getChannelLogs(where, limit, options)
.then( logs => {
callback(null, logs);
resolve(logs);
})
.catch( e => {
callback(e);
reject(e);
});
});
}
}
module.exports = Client;