mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
Added get channel logs
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user