Skip to content

Commit aa67dd1

Browse files
Adding testing endpoint
The twitch webhooks API requires a publicly available endpoint that is protected by a valid SSL certificate. We will put this testing endpoint up so we can start building out a chat subscription endpoint
1 parent 8ec7440 commit aa67dd1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ public class TwitchWebHookController : ControllerBase {
2525
/// <returns></returns>
2626
[HttpPost]
2727
[Route("chat")]
28-
public IActionResult TwitchChatMessageCallback(string stuff, CancellationToken token) {
29-
_log.Info(stuff);
28+
public async Task<IActionResult> TwitchChatMessageCallback(CancellationToken token) {
29+
using StreamReader stream = new StreamReader(this.HttpContext.Request.Body);
30+
string stuff = await stream.ReadToEndAsync(token);
31+
_log.Info($"TwitchChatMessageCallback: {stuff}");
3032
return Ok(true);
3133
}
3234
}

0 commit comments

Comments
 (0)