Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

Commit

Permalink
fix(Paginator): order
Browse files Browse the repository at this point in the history
  • Loading branch information
alexthemaster committed Aug 18, 2020
1 parent c8966ca commit 4f895f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/util/Paginator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ export class Paginator {
// Send a message with the default page embed
const message = await this._message.channel.send(this.pages[this.currentPage - 1].setFooter(this.footer));
this._collector = message.createReactionCollector((_reaction, user: User) => user === this._message.author);
// React to the sent message with all the navigation emojis
await Promise.all(Object.values(this._navigation).map(async value => await message.react(value)));
// Use the collector created above to "listen" for new reactions
this._collector.on('collect', async (reaction) => {
const action = getKeyByValue(this._navigation, reaction.emoji.name);
Expand All @@ -48,6 +46,8 @@ export class Paginator {
await this._updatePage(message);
await this._removeReactions(message);
})
// React to the sent message with all the navigation emojis
await Promise.all(Object.values(this._navigation).map(async value => await message.react(value)));
}

/** Add a page to the embed */
Expand Down

0 comments on commit 4f895f4

Please sign in to comment.