Getting Golive Event for Changing Game

When I receive a webhook, I fetch the last webhook from storage.

And compare the two.

Then depending on my criteria I choose to notify or not.

In your case, you just need to compare the old data to the new data and see if it’s changed from blank (or empty array) to a payload of data. This also means if someone wants to get the current stream title/game/uptime in discord I don’t need to do a API request as I have it in storage.

In this case I use Redis for storage.

Basically this is identical to using long poll, so if I switched from webhooks to long poll, I wouldn’t need to change the handler, just the fetch/data source method(s).

The only reason I mention this, is under your current method, you are renotifiying Discord when a stream dumps and restarts (dropped connection, OBS Crash etc). So you need this “fix” in your system anyway.