1- using DSharpPlus ;
1+ using DSharpPlus ;
22using DSharpPlus . Entities ;
33using DSharpPlus . EventArgs ;
44
@@ -38,7 +38,10 @@ internal DiscordModal(string title, IEnumerable<DiscordModalTextInput> inputs, D
3838 /// <exception cref="ArgumentNullException"><paramref name="interaction" /> is <see langword="null" />.</exception>
3939 public async Task < DiscordModalResponse > RespondToAsync ( DiscordInteraction interaction , TimeSpan timeout )
4040 {
41- if ( interaction is null ) throw new ArgumentNullException ( nameof ( interaction ) ) ;
41+ if ( interaction is null )
42+ {
43+ throw new ArgumentNullException ( nameof ( interaction ) ) ;
44+ }
4245
4346 var builder = new DiscordInteractionResponseBuilder ( ) ;
4447 builder . WithTitle ( Title ) ;
@@ -53,7 +56,9 @@ public async Task<DiscordModalResponse> RespondToAsync(DiscordInteraction intera
5356 var cancellationTokenSource = new CancellationTokenSource ( ) ;
5457 cancellationTokenSource . Token . Register ( ( ) => _taskCompletionSource . TrySetCanceled ( ) ) ;
5558 if ( timeout != Timeout . InfiniteTimeSpan )
59+ {
5660 cancellationTokenSource . CancelAfter ( timeout ) ;
61+ }
5762
5863 try
5964 {
@@ -69,7 +74,9 @@ public async Task<DiscordModalResponse> RespondToAsync(DiscordInteraction intera
6974 private Task OnModalSubmitted ( DiscordClient sender , ModalSubmitEventArgs e )
7075 {
7176 if ( e . Interaction . Data . CustomId != _customId )
77+ {
7278 return Task . CompletedTask ;
79+ }
7380
7481 _discordClient . ModalSubmitted -= OnModalSubmitted ;
7582
@@ -78,7 +85,9 @@ private Task OnModalSubmitted(DiscordClient sender, ModalSubmitEventArgs e)
7885 foreach ( TextInputComponent inputComponent in inputComponents )
7986 {
8087 if ( _inputs . TryGetValue ( inputComponent . CustomId , out DiscordModalTextInput ? input ) )
88+ {
8189 input . Value = inputComponent . Value ;
90+ }
8291 }
8392
8493 _taskCompletionSource . TrySetResult ( ) ;
0 commit comments