Skip to content

Commit

Permalink
fix(TextBasedChannel): allow passing an APIMessage with split (#5815)
Browse files Browse the repository at this point in the history
* fix(TextBasedChannel): allow passing an APIMessage with split

* fix(Webhook): allow passing an APIMessage with slit
  • Loading branch information
almeidx committed Jun 11, 2021
1 parent 19fd162 commit 93b0a4e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/structures/Webhook.js
Expand Up @@ -158,9 +158,10 @@ class Webhook {
apiMessage = options.resolveData();
} else {
apiMessage = APIMessage.create(this, options).resolveData();
if (Array.isArray(apiMessage.data.content)) {
return Promise.all(apiMessage.split().map(this.send.bind(this)));
}
}

if (Array.isArray(apiMessage.data.content)) {
return Promise.all(apiMessage.split().map(this.send.bind(this)));
}

const { data, files } = await apiMessage.resolveFiles();
Expand Down
7 changes: 4 additions & 3 deletions src/structures/interfaces/TextBasedChannel.js
Expand Up @@ -173,9 +173,10 @@ class TextBasedChannel {
apiMessage = options.resolveData();
} else {
apiMessage = APIMessage.create(this, options).resolveData();
if (Array.isArray(apiMessage.data.content)) {
return Promise.all(apiMessage.split().map(this.send.bind(this)));
}
}

if (Array.isArray(apiMessage.data.content)) {
return Promise.all(apiMessage.split().map(this.send.bind(this)));
}

const { data, files } = await apiMessage.resolveFiles();
Expand Down

0 comments on commit 93b0a4e

Please sign in to comment.