File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- using System ;
2- using System . Collections . Generic ;
3- using System . Linq ;
4- using System . Text ;
5- using System . Threading . Tasks ;
6-
7- namespace Disc . NET . Shared . Enums
1+ namespace Disc . NET . Shared . Enums
82{
93 public enum InteractionType
104 {
Original file line number Diff line number Diff line change @@ -66,22 +66,15 @@ internal static class JsonDocumentExtension
6666 return null ;
6767 }
6868
69- public static JsonDocument ? GetEventContextData ( this JsonDocument document )
69+ public static JsonDocument GetEventContextData ( this JsonDocument document )
7070 {
7171 if ( document . RootElement . TryGetProperty ( "d" , out var dElement ) &&
7272 dElement . ValueKind is JsonValueKind . Object or JsonValueKind . Array )
7373 {
74- try
75- {
76- return JsonSerializer . Deserialize < JsonDocument > ( dElement . GetRawText ( ) ) ;
77- }
78- catch
79- {
80- return null ;
81- }
74+ return JsonSerializer . Deserialize < JsonDocument > ( dElement . GetRawText ( ) ) ?? throw new Exception ( ) ;
8275 }
8376
84- return null ;
77+ throw new Exception ( ) ;
8578 }
8679
8780 public static string ? GetJsonStringProperty ( this JsonDocument document , string propertyName )
Original file line number Diff line number Diff line change @@ -19,8 +19,8 @@ public async Task RunAsync(AppConfiguration configuration)
1919 {
2020 DiscNetContainer . GetInstance ( ) . RegisterDependencies ( ) ;
2121 }
22- var gateway = new GatewayConnection ( _logger ) ;
23- await gateway . ConnectAsync ( configuration ) ;
22+ var gateway = new GatewayConnection ( configuration , _logger ) ;
23+ await gateway . ConnectAsync ( ) ;
2424 }
2525
2626 public App WithDebugLogger ( )
You can’t perform that action at this time.
0 commit comments