mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-20 21:43:33 +01:00
Fix catch in _sendMessageRequest
This commit is contained in:
@@ -73,7 +73,7 @@ class RESTMethods {
|
|||||||
const datas = [];
|
const datas = [];
|
||||||
const promise = this.rest.makeRequest('post', Constants.Endpoints.channelMessages(channel.id), true, {
|
const promise = this.rest.makeRequest('post', Constants.Endpoints.channelMessages(channel.id), true, {
|
||||||
content: content[0], tts, nonce,
|
content: content[0], tts, nonce,
|
||||||
}, file);
|
}, file).catch(reject);
|
||||||
for (let i = 1; i <= content.length; i++) {
|
for (let i = 1; i <= content.length; i++) {
|
||||||
if (i < content.length) {
|
if (i < content.length) {
|
||||||
promise.then(data => {
|
promise.then(data => {
|
||||||
@@ -85,7 +85,7 @@ class RESTMethods {
|
|||||||
} else {
|
} else {
|
||||||
promise.then(data => {
|
promise.then(data => {
|
||||||
datas.push(data);
|
datas.push(data);
|
||||||
resolve(this.rest.client.actions.MessageCreate.handle(datas).messages).catch(reject);
|
resolve(this.rest.client.actions.MessageCreate.handle(datas).messages);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user