aboutsummaryrefslogtreecommitdiff
path: root/src/lib/common/ButtonPaginator.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-10-23 18:09:55 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-10-23 18:09:55 -0400
commit36ff682e742021918d134ff91a2bee3041b5a2b9 (patch)
tree979fb8a10eb7f210989ed3272754ab3f001641f5 /src/lib/common/ButtonPaginator.ts
parent44521f4560dc8b0bab055685437d8fa65a34377f (diff)
downloadtanzanite-36ff682e742021918d134ff91a2bee3041b5a2b9.tar.gz
tanzanite-36ff682e742021918d134ff91a2bee3041b5a2b9.tar.bz2
tanzanite-36ff682e742021918d134ff91a2bee3041b5a2b9.zip
a ton of bug fixes
Diffstat (limited to 'src/lib/common/ButtonPaginator.ts')
-rw-r--r--src/lib/common/ButtonPaginator.ts16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/lib/common/ButtonPaginator.ts b/src/lib/common/ButtonPaginator.ts
index 68955cc..6d4c49a 100644
--- a/src/lib/common/ButtonPaginator.ts
+++ b/src/lib/common/ButtonPaginator.ts
@@ -85,7 +85,7 @@ export class ButtonPaginator {
}
protected async collect(interaction: MessageComponentInteraction) {
- if (interaction.user.id !== this.message.author.id || !client.config.owners.includes(interaction.user.id))
+ if (interaction.user.id !== this.message.author.id && !client.config.owners.includes(interaction.user.id))
return await interaction?.deferUpdate().catch(() => undefined);
switch (interaction.customId) {
@@ -118,12 +118,14 @@ export class ButtonPaginator {
}
protected async end() {
- if (!this.deleteOnExit)
- return await this.sentMessage!.edit({
- content: this.text,
- embeds: [this.embeds[this.curPage]],
- components: [this.getPaginationRow(true)]
- }).catch(() => undefined);
+ if (this.sentMessage && !this.sentMessage.deleted)
+ return await this.sentMessage
+ .edit({
+ content: this.text,
+ embeds: [this.embeds[this.curPage]],
+ components: [this.getPaginationRow(true)]
+ })
+ .catch(() => undefined);
}
protected async edit(interaction: MessageComponentInteraction) {