mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
feat(Message): throw a TypeError if delete is passed a non-object (#3772)
This commit is contained in:
@@ -482,7 +482,9 @@ class Message extends Base {
|
||||
* .then(msg => console.log(`Deleted message from ${msg.author.username}`))
|
||||
* .catch(console.error);
|
||||
*/
|
||||
delete({ timeout = 0, reason } = {}) {
|
||||
delete(options = {}) {
|
||||
if (typeof options !== 'object') throw 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);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user