From 85aadc17e1c1c81e891ee906ea6a0d5ffd759752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A7=81Ash=C3=BB=EA=A7=82?= <30575805+Ashu11-A@users.noreply.github.com> Date: Fri, 24 May 2024 04:28:28 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=AE=20Components=20can=20be=20undefine?= =?UTF-8?q?d?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/plugin_base/src/discord/base/CustomIntetaction.ts | 4 ++-- plugins/tickets/src/discord/base/CustomIntetaction.ts | 4 ++-- plugins/utils/src/discord/base/CustomIntetaction.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/plugin_base/src/discord/base/CustomIntetaction.ts b/plugins/plugin_base/src/discord/base/CustomIntetaction.ts index ab8e745c..fd3df053 100644 --- a/plugins/plugin_base/src/discord/base/CustomIntetaction.ts +++ b/plugins/plugin_base/src/discord/base/CustomIntetaction.ts @@ -34,14 +34,14 @@ export interface APIModalInteractionResponseCallbackData { /** * Between 1 and 5 (inclusive) components that make up the modal */ - components: ActionRowBuilder[] + components?: ActionRowBuilder[] } export class ModalBuilder extends Modal { constructor({ components, customId, title }: APIModalInteractionResponseCallbackData) { super() this.setTitle(title) - this.setComponents(components) + if (components) this.setComponents(components) this.setCustomId(`${name}_${customId}`) } } \ No newline at end of file diff --git a/plugins/tickets/src/discord/base/CustomIntetaction.ts b/plugins/tickets/src/discord/base/CustomIntetaction.ts index ab8e745c..fd3df053 100644 --- a/plugins/tickets/src/discord/base/CustomIntetaction.ts +++ b/plugins/tickets/src/discord/base/CustomIntetaction.ts @@ -34,14 +34,14 @@ export interface APIModalInteractionResponseCallbackData { /** * Between 1 and 5 (inclusive) components that make up the modal */ - components: ActionRowBuilder[] + components?: ActionRowBuilder[] } export class ModalBuilder extends Modal { constructor({ components, customId, title }: APIModalInteractionResponseCallbackData) { super() this.setTitle(title) - this.setComponents(components) + if (components) this.setComponents(components) this.setCustomId(`${name}_${customId}`) } } \ No newline at end of file diff --git a/plugins/utils/src/discord/base/CustomIntetaction.ts b/plugins/utils/src/discord/base/CustomIntetaction.ts index ab8e745c..fd3df053 100644 --- a/plugins/utils/src/discord/base/CustomIntetaction.ts +++ b/plugins/utils/src/discord/base/CustomIntetaction.ts @@ -34,14 +34,14 @@ export interface APIModalInteractionResponseCallbackData { /** * Between 1 and 5 (inclusive) components that make up the modal */ - components: ActionRowBuilder[] + components?: ActionRowBuilder[] } export class ModalBuilder extends Modal { constructor({ components, customId, title }: APIModalInteractionResponseCallbackData) { super() this.setTitle(title) - this.setComponents(components) + if (components) this.setComponents(components) this.setCustomId(`${name}_${customId}`) } } \ No newline at end of file