setTimeout should use args (#1623)

This commit is contained in:
Drahcirius
2017-06-27 15:22:17 -04:00
committed by Amish Shah
parent f1a74f214e
commit 4ce4dc019e
2 changed files with 4 additions and 4 deletions

View File

@@ -420,9 +420,9 @@ class Client extends EventEmitter {
*/
setTimeout(fn, delay, ...args) {
const timeout = setTimeout(() => {
fn();
fn(...args);
this._timeouts.delete(timeout);
}, delay, ...args);
}, delay);
this._timeouts.add(timeout);
return timeout;
}

View File

@@ -65,9 +65,9 @@ class WebhookClient extends Webhook {
*/
setTimeout(fn, delay, ...args) {
const timeout = setTimeout(() => {
fn();
fn(...args);
this._timeouts.delete(timeout);
}, delay, ...args);
}, delay);
this._timeouts.add(timeout);
return timeout;
}