Skip to content

Commit f4ba5a5

Browse files
wip
1 parent 0b7e837 commit f4ba5a5

File tree

4 files changed

+35
-25
lines changed

4 files changed

+35
-25
lines changed

src/Nullinside.Api.TwitchBot/Controllers/TwitchWebHookController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public async Task<ContentResult> TwitchChatMessageCallback(CancellationToken tok
3535
string stuff = await stream.ReadToEndAsync(token);
3636
_log.Info($"TwitchChatMessageCallback: {stuff}");
3737

38-
var hi =JsonConvert.DeserializeObject<TwitchChallange>(stuff);
38+
var hi =JsonConvert.DeserializeObject<TwitchChallangeResponse>(stuff);
3939
var resp = new ContentResult();
4040
resp.ContentType = "text/plain";
4141
resp.StatusCode = (int)HttpStatusCode.OK;
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using Newtonsoft.Json;
2+
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
3+
4+
namespace Nullinside.Api.TwitchBot.Model;
5+
6+
public class TwitchChallangeResponse : TwitchWebhookResponse {
7+
[JsonProperty("challenge")]
8+
public Guid? Challenge { get; set; }
9+
}
10+
11+
public partial class Condition
12+
{
13+
[JsonProperty("broadcaster_user_id")]
14+
public string? BroadcasterUserId { get; set; }
15+
}
16+
17+
public partial class Transport
18+
{
19+
[JsonProperty("method")]
20+
public string? Method { get; set; }
21+
22+
[JsonProperty("callback")]
23+
public Uri? Callback { get; set; }
24+
}

src/Nullinside.Api.TwitchBot/Model/TwitchChallange.cs renamed to src/Nullinside.Api.TwitchBot/Model/TwitchSubscriptionResponse.cs

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,7 @@
33

44
namespace Nullinside.Api.TwitchBot.Model;
55

6-
public class TwitchChallange {
7-
[JsonProperty("challenge")]
8-
public Guid? Challenge { get; set; }
9-
10-
[JsonProperty("subscription")]
11-
public Subscription? Subscription { get; set; }
12-
}
13-
14-
public partial class Subscription
6+
public partial class TwitchSubscriptionResponse
157
{
168
[JsonProperty("condition")]
179
public Condition? Condition { get; set; }
@@ -36,19 +28,4 @@ public partial class Subscription
3628

3729
[JsonProperty("status")]
3830
public string? Status { get; set; }
39-
}
40-
41-
public partial class Condition
42-
{
43-
[JsonProperty("broadcaster_user_id")]
44-
public string? BroadcasterUserId { get; set; }
45-
}
46-
47-
public partial class Transport
48-
{
49-
[JsonProperty("method")]
50-
public string? Method { get; set; }
51-
52-
[JsonProperty("callback")]
53-
public Uri? Callback { get; set; }
5431
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using Newtonsoft.Json;
2+
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
3+
4+
namespace Nullinside.Api.TwitchBot.Model;
5+
6+
public class TwitchWebhookResponse {
7+
[JsonProperty("subscription")]
8+
public TwitchSubscriptionResponse? Subscription { get; set; }
9+
}

0 commit comments

Comments
 (0)