Skip to content

Commit

Permalink
🔮 Components can be undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashu11-A committed May 24, 2024
1 parent e431cf3 commit 85aadc1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions plugins/plugin_base/src/discord/base/CustomIntetaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ export interface APIModalInteractionResponseCallbackData {
/**
* Between 1 and 5 (inclusive) components that make up the modal
*/
components: ActionRowBuilder<TextInputBuilder>[]
components?: ActionRowBuilder<TextInputBuilder>[]
}

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}`)
}
}
4 changes: 2 additions & 2 deletions plugins/tickets/src/discord/base/CustomIntetaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ export interface APIModalInteractionResponseCallbackData {
/**
* Between 1 and 5 (inclusive) components that make up the modal
*/
components: ActionRowBuilder<TextInputBuilder>[]
components?: ActionRowBuilder<TextInputBuilder>[]
}

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}`)
}
}
4 changes: 2 additions & 2 deletions plugins/utils/src/discord/base/CustomIntetaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ export interface APIModalInteractionResponseCallbackData {
/**
* Between 1 and 5 (inclusive) components that make up the modal
*/
components: ActionRowBuilder<TextInputBuilder>[]
components?: ActionRowBuilder<TextInputBuilder>[]
}

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}`)
}
}

0 comments on commit 85aadc1

Please sign in to comment.