File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,8 @@ export async function handlePatreonTrigger(interaction: ButtonInteraction) {
7575 . setCustomId ( 'groupId' )
7676 . setLabel ( "Your group's ID" )
7777 . setPlaceholder ( "Ex: 139 (Can be found on your group's page URL.)" )
78- . setStyle ( 1 ) ;
78+ . setStyle ( 1 )
79+ . setRequired ( false ) ;
7980
8081 modal . addComponents ( new ActionRowBuilder < TextInputBuilder > ( ) . addComponents ( usernameInput ) ) ;
8182
@@ -100,12 +101,12 @@ export async function handlePatreonModalSubmit(interaction: ModalSubmitInteracti
100101 const groupIdValue = interaction . fields . getTextInputValue ( 'groupId' ) ;
101102 const isInteger = typeof groupIdValue === 'string' && Number . isInteger ( parseInt ( groupIdValue ) ) ;
102103
103- if ( ! isInteger ) {
104+ if ( groupIdValue !== '' && ! isInteger ) {
104105 interaction . reply ( { content : '❌ Please provide a valid group ID.' , ephemeral : true } ) ;
105106 return ;
106107 }
107108
108- groupId = parseInt ( groupIdValue ) ;
109+ groupId = groupIdValue === '' ? undefined : parseInt ( groupIdValue ) ;
109110 }
110111
111112 try {
You can’t perform that action at this time.
0 commit comments