mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
Fixed small issue in getChannelLogs
Now also returns the last message and not the penultimate as the latest
This commit is contained in:
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);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user