Skip to content

Commit

Permalink
fix(PaginatedMessage): only add options and placeholder to the built-…
Browse files Browse the repository at this point in the history
…in StringSelectMenu (#575)
  • Loading branch information
favna committed Apr 27, 2023
1 parent 3f5d500 commit 49d588b
Showing 1 changed file with 14 additions and 12 deletions.
Expand Up @@ -995,18 +995,20 @@ export class PaginatedMessage {
return isMessageButtonInteractionData(interaction)
? new ButtonBuilder(interaction)
: new StringSelectMenuBuilder({
options: await Promise.all(
this.pages.map(async (_, index) => {
return {
...(await this.selectMenuOptions(
index + 1,
this.resolvePaginatedMessageInternationalizationContext(messageOrInteraction, targetUser)
)),
value: index.toString()
};
})
),
placeholder: this.selectMenuPlaceholder,
...(interaction.customId === '@sapphire/paginated-messages.goToPage' && {
options: await Promise.all(
this.pages.map(async (_, index) => {
return {
...(await this.selectMenuOptions(
index + 1,
this.resolvePaginatedMessageInternationalizationContext(messageOrInteraction, targetUser)
)),
value: index.toString()
};
})
),
placeholder: this.selectMenuPlaceholder
}),
...interaction
});
})
Expand Down

0 comments on commit 49d588b

Please sign in to comment.