Make pagination only apply when there's more than a single page
This commit is contained in:
parent
ac1242f74b
commit
dea160c73b
1 changed files with 65 additions and 63 deletions
|
@ -16,6 +16,7 @@ module.exports = async (client, message, pages, timeout = 120000) => {
|
|||
};
|
||||
let page = 0;
|
||||
let currentPage = await client.createMessage(message.channel.id, Object.assign(pages[page], options));
|
||||
if (pages.length > 1) {
|
||||
const emojiList = ["◀", "🔢", "▶", "🗑"];
|
||||
for (const emoji of emojiList) {
|
||||
await currentPage.addReaction(emoji);
|
||||
|
@ -80,5 +81,6 @@ module.exports = async (client, message, pages, timeout = 120000) => {
|
|||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
return currentPage;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue