TrojanerHD / TrojanerBot

My discord bot
MIT License
4 stars 2 forks source link

[streamer-dms] Sometimes dms get sent multiple times #33

Closed TrojanerHD closed 2 years ago

TrojanerHD commented 2 years ago

This possibly occurs due to asynchronous functions

TrojanerHD commented 2 years ago

After some monitoring, I found out that the Twitch API sometimes says the streamer is offline shortly after they went online. Like:

1. *Streamer goes online* Live
2. Live
3. Not Live
4. Live
5. *Streamer goes offline* Not Live

(Requests get sent every five seconds) In Commit 06ac1a38e32e160f7b16ec7fd0cb9590a85004e1 this was hotfixed by disallowing to change the status to offline when the streamer went live in the last five minutes. The only disadvantage is that the bot doesn't send a second message if the streamer restarts the stream five minutes after the first stream start.

This is satisfying enough to say this bug is fixed