Skip to content

Commit

Permalink
Merge pull request #385 from aternosorg/moderations
Browse files Browse the repository at this point in the history
 disable the correct buttons
  • Loading branch information
JulianVennen authored Sep 29, 2021
2 parents a834f00 + fbde6c0 commit 6f99fdd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@google-cloud/logging": "^9.1.1",
"@googleapis/youtube": "^2.0.0",
"diff": "^4.0.2",
"discord.js": "^13.2.0-dev.1631620977.be8912a",
"discord.js": "^13.2.0-dev.1632916991.fe95005",
"fuse.js": "^6.4.6",
"got": "^11.8.2",
"mysql": "^2.18.1",
Expand Down
14 changes: 7 additions & 7 deletions src/Command.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,21 +335,21 @@ class Command {
* @param {Number} [duration] inactivity timeout in ms (default: 60s)
*/
async multiPageResponse(generatePage, pages, duration = 60000) {
const nextButton = new MessageButton({
const previousButton = new MessageButton({
customId: 'previous',
style: 'SECONDARY',
emoji: icons.left,
disabled: true,
}),
previousButton = new MessageButton({
nextButton = new MessageButton({
customId: 'next',
style: 'SECONDARY',
emoji: icons.right,
disabled: pages === 1
});
await this.reply({
components: [new MessageActionRow({
components: [nextButton, previousButton]
components: [previousButton, nextButton]
})]
}, await generatePage(0));
const message = this.response;
Expand Down Expand Up @@ -393,8 +393,8 @@ class Command {
embeds: [await generatePage(index)],
components: [new MessageActionRow({
components: [
nextButton.setDisabled(index === pages -1),
previousButton.setDisabled(index === 0)
previousButton.setDisabled(index === 0),
nextButton.setDisabled(index === pages -1)
]
})]
});
Expand All @@ -407,8 +407,8 @@ class Command {
components.stop('TIME');
await message.edit({
components: [
nextButton.setDisabled(true),
previousButton.setDisabled(true)
previousButton.setDisabled(true),
nextButton.setDisabled(true)
]});
}
}
Expand Down

0 comments on commit 6f99fdd

Please sign in to comment.