From 1e63f3756e814d6b1a2a9c17af9c2b28ce37e472 Mon Sep 17 00:00:00 2001 From: Ryan Munro Date: Wed, 16 Sep 2020 02:35:54 +1000 Subject: [PATCH] fix(Message): use Promise#reject instead of Throw on Message#delete (#4818) --- src/structures/Message.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/structures/Message.js b/src/structures/Message.js index 22a0de773..439eb4aaa 100644 --- a/src/structures/Message.js +++ b/src/structures/Message.js @@ -550,7 +550,7 @@ class Message extends Base { * .catch(console.error); */ delete(options = {}) { - if (typeof options !== 'object') throw new TypeError('INVALID_TYPE', 'options', 'object', true); + if (typeof options !== 'object') return Promise.reject(new TypeError('INVALID_TYPE', 'options', 'object', true)); const { timeout = 0, reason } = options; if (timeout <= 0) { return this.channel.messages.delete(this.id, reason).then(() => this);