File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -541,15 +541,17 @@ export class DiscordManager {
541541 else if ( interaction . isModalSubmit ( ) ) {
542542 extendedLogging = `Modal Submit Interaction: Modal ID: ${ interaction . customId } ` ;
543543
544- const fields = interaction . fields . fields ;
545- if ( fields . size > 0 ) {
546- extendedLogging += `, Field Values: ` ;
547- for ( const [ key , field ] of Array . from ( fields . entries ( ) ) ) {
548- const displayValue = field . value . length > 50 ? `${ field . value . substring ( 0 , 50 ) } ...` : field . value ;
549- extendedLogging += `[${ key } ]: ${ displayValue } , ` ;
544+ for ( const [ key , field ] of interaction . fields . fields ) {
545+ if ( field . type === discordjs . ComponentType . TextInput ) {
546+ const value = field . value ;
547+ const displayValue =
548+ value . length > 50 ? `${ value . slice ( 0 , 50 ) } ...` : value ;
549+
550+ extendedLogging += ` [${ key } ]: ${ displayValue } ,` ;
550551 }
551- extendedLogging = extendedLogging . slice ( 0 , - 2 ) ;
552552 }
553+
554+ extendedLogging = extendedLogging . replace ( / , $ / , '' ) ;
553555 }
554556 else {
555557 /* Do nothing for unsupported interaction types. */
You can’t perform that action at this time.
0 commit comments