Skip to content

Commit 1e63f37

Browse files
authored
fix(Message): use Promise#reject instead of Throw on Message#delete (#4818)
1 parent 8fa3a89 commit 1e63f37

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/structures/Message.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ class Message extends Base {
550550
* .catch(console.error);
551551
*/
552552
delete(options = {}) {
553-
if (typeof options !== 'object') throw new TypeError('INVALID_TYPE', 'options', 'object', true);
553+
if (typeof options !== 'object') return Promise.reject(new TypeError('INVALID_TYPE', 'options', 'object', true));
554554
const { timeout = 0, reason } = options;
555555
if (timeout <= 0) {
556556
return this.channel.messages.delete(this.id, reason).then(() => this);

0 commit comments

Comments
 (0)