mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 04:23:31 +01:00
fix(TextBasedChannel): allow passing an APIMessage with split (#5815)
* fix(TextBasedChannel): allow passing an APIMessage with split * fix(Webhook): allow passing an APIMessage with slit
This commit is contained in:
@@ -158,10 +158,11 @@ class Webhook {
|
|||||||
apiMessage = options.resolveData();
|
apiMessage = options.resolveData();
|
||||||
} else {
|
} else {
|
||||||
apiMessage = APIMessage.create(this, options).resolveData();
|
apiMessage = APIMessage.create(this, options).resolveData();
|
||||||
|
}
|
||||||
|
|
||||||
if (Array.isArray(apiMessage.data.content)) {
|
if (Array.isArray(apiMessage.data.content)) {
|
||||||
return Promise.all(apiMessage.split().map(this.send.bind(this)));
|
return Promise.all(apiMessage.split().map(this.send.bind(this)));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
const { data, files } = await apiMessage.resolveFiles();
|
const { data, files } = await apiMessage.resolveFiles();
|
||||||
return this.client.api
|
return this.client.api
|
||||||
|
|||||||
@@ -173,10 +173,11 @@ class TextBasedChannel {
|
|||||||
apiMessage = options.resolveData();
|
apiMessage = options.resolveData();
|
||||||
} else {
|
} else {
|
||||||
apiMessage = APIMessage.create(this, options).resolveData();
|
apiMessage = APIMessage.create(this, options).resolveData();
|
||||||
|
}
|
||||||
|
|
||||||
if (Array.isArray(apiMessage.data.content)) {
|
if (Array.isArray(apiMessage.data.content)) {
|
||||||
return Promise.all(apiMessage.split().map(this.send.bind(this)));
|
return Promise.all(apiMessage.split().map(this.send.bind(this)));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
const { data, files } = await apiMessage.resolveFiles();
|
const { data, files } = await apiMessage.resolveFiles();
|
||||||
return this.client.api.channels[this.id].messages
|
return this.client.api.channels[this.id].messages
|
||||||
|
|||||||
Reference in New Issue
Block a user