From d06baae920d06d63a77f0956d1f3ea129bd07ac2 Mon Sep 17 00:00:00 2001 From: kevinlul <6320810+kevinlul@users.noreply.github.com> Date: Wed, 20 Mar 2024 20:52:12 -0400 Subject: [PATCH] ArtSwitcher: don't set up handler if all buttons are disabled --- src/art.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/art.ts b/src/art.ts index c0db7a2..4f4cf08 100644 --- a/src/art.ts +++ b/src/art.ts @@ -112,6 +112,10 @@ export class ArtSwitcher { async editReply(parentInteraction: ChatInputCommandInteraction, resultLanguage: Locale): Promise { const reply = await parentInteraction.editReply(this.replyOptions); + // Don't bother setting up button handler if all buttons are disabled + if (this.images.length === 1) { + return reply; + } const filter = (childInteraction: ButtonInteraction): boolean => { this.logger.info(serialiseInteraction(parentInteraction), `click: ${childInteraction.user.id}`); if (childInteraction.user.id === parentInteraction.user.id) {