mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix(Message): use Promise#reject instead of Throw on Message#delete (#4818)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user