Fix paginator

This commit is contained in:
Snazzah 2021-06-10 21:08:14 -05:00
parent 751b1b2fbc
commit 4532f9a71e
No known key found for this signature in database
GPG key ID: 5E71D54F3D86282E
2 changed files with 8 additions and 4 deletions

View file

@ -7,7 +7,7 @@ module.exports = class ListAll extends Command {
permissions: ['admin'], permissions: ['admin'],
minimumArgs: 0 minimumArgs: 0
}; } }; }
async exec(message) { async exec(message, { args }) {
const pairs = await this.client.sqlite.getAll(); const pairs = await this.client.sqlite.getAll();
if (pairs.length <= 0) if (pairs.length <= 0)
return message.channel.createMessage('No users found in the database.'); return message.channel.createMessage('No users found in the database.');
@ -35,6 +35,10 @@ module.exports = class ListAll extends Command {
? `${pair.wallet_available} available, ${pair.wallet_reserve} staked.` ? `${pair.wallet_available} available, ${pair.wallet_reserve} staked.`
: 'Wallet Unavailable'}\n` : 'Wallet Unavailable'}\n`
}); });
if (args[0])
paginator.toPage(args[0]);
return paginator.start(message.channel.id, message.author.id); return paginator.start(message.channel.id, message.author.id);
} }
get metadata() { return { get metadata() { return {

View file

@ -40,11 +40,11 @@ module.exports = class Events {
} }
} }
onReaction(message, emoji, userID) { onReaction(message, emoji, member) {
const id = `${message.id}:${userID}`; const id = `${message.id}:${member.id}`;
if (this.client.messageAwaiter.reactionCollectors.has(id)) { if (this.client.messageAwaiter.reactionCollectors.has(id)) {
const collector = this.client.messageAwaiter.reactionCollectors.get(id); const collector = this.client.messageAwaiter.reactionCollectors.get(id);
collector._onReaction(emoji, userID); collector._onReaction(emoji, member.id);
} }
} }
}; };