mirror of
https://github.com/danbulant/discord.js
synced 2026-06-20 23:21:04 +00:00
fix(Message): use Promise#reject instead of Throw on Message#delete (#4818)
This commit is contained in:
parent
8fa3a89482
commit
1e63f3756e
1 changed files with 1 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue