Skip to content

Commit 932f4a6

Browse files
committed
up
1 parent 98b3514 commit 932f4a6

3 files changed

Lines changed: 6 additions & 19 deletions

File tree

src/Disc.NET.Shared/Enums/InteractionType.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
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
{

src/Disc.NET.Shared/Extensions/JsonDocumentExtension.cs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff 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)

src/Disc.NET/App.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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()

0 commit comments

Comments
 (0)