mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
Add textBasedChannel.bulkDelete()
This commit is contained in:
@@ -76,6 +76,20 @@ class RESTMethods {
|
||||
});
|
||||
}
|
||||
|
||||
bulkDeleteMessages(channel, messages) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const options = { messages };
|
||||
this.rest.makeRequest('post', `${Constants.Endpoints.channelMessages(channel.id)}/bulk_delete`, true, options)
|
||||
.then(() => {
|
||||
resolve(this.rest.client.actions.MessageDeleteBulk.handle({
|
||||
channel_id: channel.id,
|
||||
ids: messages,
|
||||
}).messages);
|
||||
})
|
||||
.catch(reject);
|
||||
});
|
||||
}
|
||||
|
||||
updateMessage(message, content) {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.rest.makeRequest('patch', Constants.Endpoints.channelMessage(message.channel.id, message.id), true, {
|
||||
|
||||
Reference in New Issue
Block a user