aboutsummaryrefslogtreecommitdiff
path: root/src/lib/common/ButtonPaginator.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-11-22 19:01:46 -0500
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-11-22 19:01:46 -0500
commitfce1fc87feb3e6dad1a956d757d856833c9ea5f6 (patch)
tree723ca41af60df525b89c6ff5b4e9574f78235734 /src/lib/common/ButtonPaginator.ts
parent23bf2485fe17472f17bd0ee0af6b22973e317550 (diff)
downloadtanzanite-fce1fc87feb3e6dad1a956d757d856833c9ea5f6.tar.gz
tanzanite-fce1fc87feb3e6dad1a956d757d856833c9ea5f6.tar.bz2
tanzanite-fce1fc87feb3e6dad1a956d757d856833c9ea5f6.zip
update contributors, fix formatting, added a bunch of repo forks
Diffstat (limited to 'src/lib/common/ButtonPaginator.ts')
-rw-r--r--src/lib/common/ButtonPaginator.ts26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/lib/common/ButtonPaginator.ts b/src/lib/common/ButtonPaginator.ts
index 6a2dba2..b8ae249 100644
--- a/src/lib/common/ButtonPaginator.ts
+++ b/src/lib/common/ButtonPaginator.ts
@@ -1,11 +1,11 @@
import { DeleteButton, type BushMessage, type BushSlashMessage } from '#lib';
import {
- Constants,
- MessageActionRow,
- MessageButton,
- MessageEmbed,
- type MessageComponentInteraction,
- type MessageEmbedOptions
+ Constants,
+ MessageActionRow,
+ MessageButton,
+ MessageEmbed,
+ type MessageComponentInteraction,
+ type MessageEmbedOptions
} from 'discord.js';
export class ButtonPaginator {
@@ -75,7 +75,7 @@ export class ButtonPaginator {
})) as BushMessage;
const collector = this.sentMessage.createMessageComponentCollector({
- filter: (i) => i.customId.startsWith('paginate_') && i.message.id === this.sentMessage!.id,
+ filter: (i) => i.customId.startsWith('paginate_') && i.message?.id === this.sentMessage!.id,
time: 300000
});
@@ -128,11 +128,13 @@ export class ButtonPaginator {
}
protected async edit(interaction: MessageComponentInteraction) {
- return interaction?.update({
- content: this.text,
- embeds: [this.embeds[this.curPage]],
- components: [this.getPaginationRow()]
- }).catch(() => null);
+ return interaction
+ ?.update({
+ content: this.text,
+ embeds: [this.embeds[this.curPage]],
+ components: [this.getPaginationRow()]
+ })
+ .catch(() => null);
}
protected getPaginationRow(disableAll = false): MessageActionRow {