Handle unavailable guild, fix default getChannelLogs limit

This commit is contained in:
abalabahaha
2016-01-18 17:46:15 -08:00
parent 94f067cc51
commit 68435f0619
6 changed files with 65 additions and 70 deletions

View File

@@ -167,12 +167,17 @@ export default class Client extends EventEmitter {
}
// def getChannelLogs
getChannelLogs(where, limit = 500, options = {}, callback = (/*err, logs*/) => { }) {
getChannelLogs(where, limit = 50, options = {}, callback = (/*err, logs*/) => { }) {
if (typeof options === "function") {
// options is the callback
callback = options;
options = {};
}
else if (typeof limit === "function") {
// options is the callback
callback = limit;
limit = 50;
}
return this.internal.getChannelLogs(where, limit, options)
.then(dataCallback(callback), errorCallback(callback));