From 4af5353bdfa574522339027c07af8b798cc1e263 Mon Sep 17 00:00:00 2001 From: hydrabolt Date: Wed, 12 Aug 2015 12:13:17 +0100 Subject: [PATCH] Fixed small issue in getChannelLogs Now also returns the last message and not the penultimate as the latest --- index.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 462a0b539..b7f5ac7cc 100644 --- a/index.js +++ b/index.js @@ -71,7 +71,7 @@ exports.Client.prototype.cacheServer = function(id, cb, members) { } -exports.Client.prototype.login = function(email, password, cb) { +exports.Client.prototype.login = function(email, password) { var client = this; @@ -274,7 +274,7 @@ exports.Client.prototype.channelFromId = function(id){ exports.Client.prototype.getChannelLogs = function(channel, amount, cb){ - amount = amount+1 || 0; + amount = amount || 0; var client = this; request @@ -292,9 +292,7 @@ exports.Client.prototype.getChannelLogs = function(channel, amount, cb){ for(item of res.body){ datList.add( new Message(item, channel) ); } - - datList.removeIndex(0); - + cb(datList); });