From b20610462727daa5636255aef840ce264fd25ab4 Mon Sep 17 00:00:00 2001 From: NekoCyan Date: Wed, 16 Nov 2022 23:46:08 +0700 Subject: [PATCH] fix: make condition. --- src/client/Client.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/Client.js b/src/client/Client.js index ce62c3b..5bce02f 100644 --- a/src/client/Client.js +++ b/src/client/Client.js @@ -983,9 +983,9 @@ class Client extends BaseClient { * @returns {Promise} */ sleep(miliseconds) { - return new Promise(r => setTimeout(r, miliseconds)); + return typeof miliseconds === 'number' ? new Promise(r => setTimeout(r, miliseconds)) : null; } - + /** * Validates the client options. * @param {ClientOptions} [options=this.options] Options to validate