mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 17:13:31 +01:00
Add Message Deletion via message.delete()
This commit is contained in:
@@ -50,6 +50,16 @@ class RESTMethods{
|
||||
.catch(reject);
|
||||
});
|
||||
}
|
||||
|
||||
DeleteMessage(channel, message) {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.rest.makeRequest('del', Constants.Endpoints.CHANNEL_MESSAGE(channel.id, message.id), true)
|
||||
.then(() => {
|
||||
resolve(message);
|
||||
})
|
||||
.catch(reject);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = RESTMethods;
|
||||
|
||||
@@ -71,6 +71,10 @@ class Message {
|
||||
if (data.id)
|
||||
this.id = data.id;
|
||||
}
|
||||
|
||||
delete() {
|
||||
return this.client.rest.methods.DeleteMessage(this.channel, this);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Message;
|
||||
|
||||
Reference in New Issue
Block a user