mirror of
https://github.com/danbulant/discord.js
synced 2026-06-10 02:02:40 +00:00
Fixed small issue in getChannelLogs
Now also returns the last message and not the penultimate as the latest
This commit is contained in:
parent
ddf74b76d8
commit
4af5353bdf
1 changed files with 3 additions and 5 deletions
8
index.js
8
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;
|
var client = this;
|
||||||
|
|
||||||
|
|
@ -274,7 +274,7 @@ exports.Client.prototype.channelFromId = function(id){
|
||||||
|
|
||||||
exports.Client.prototype.getChannelLogs = function(channel, amount, cb){
|
exports.Client.prototype.getChannelLogs = function(channel, amount, cb){
|
||||||
|
|
||||||
amount = amount+1 || 0;
|
amount = amount || 0;
|
||||||
var client = this;
|
var client = this;
|
||||||
|
|
||||||
request
|
request
|
||||||
|
|
@ -292,9 +292,7 @@ exports.Client.prototype.getChannelLogs = function(channel, amount, cb){
|
||||||
for(item of res.body){
|
for(item of res.body){
|
||||||
datList.add( new Message(item, channel) );
|
datList.add( new Message(item, channel) );
|
||||||
}
|
}
|
||||||
|
|
||||||
datList.removeIndex(0);
|
|
||||||
|
|
||||||
cb(datList);
|
cb(datList);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue