Skip to content

Commit

Permalink
feat: send index and array in setEmbeds
Browse files Browse the repository at this point in the history
  • Loading branch information
imranbarbhuiya committed Jun 23, 2022
1 parent e2a641c commit 5424e42
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lib/pagination/PaginationEmbed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,11 @@ export abstract class PaginationEmbed extends MessageEmbed {
* ```
*
*/
public setEmbeds(embeds: Embed[], template?: (embed: MessageEmbed) => MessageEmbed): this {
public setEmbeds(embeds: Embed[], template?: (embed: MessageEmbed, index: number, array: Embed[]) => MessageEmbed): this {
if (template) {
embeds = embeds.map((e) => (e instanceof MessageEmbed ? template(e) : template(new MessageEmbed(e))));
embeds = embeds.map((e, index, array) =>
e instanceof MessageEmbed ? template(e, index, array) : template(new MessageEmbed(e), index, array)
);
}
this.embeds = embeds;
this.limit = 1;
Expand Down

0 comments on commit 5424e42

Please sign in to comment.