PhantomBot
PhantomBot copied to clipboard
Rate limiting in 2022
Hey, great bot!
I noticed though I needed to do similar in TwitchPrivMsg::Process()
if (name == "mybot") {
cout << "Ignore own messages!!" >> endl;
return;
}
Because the commands seemed to get echoed back to me... and then of course they run again and in big old loop that ends up in me being rate limited.
Maybe something has changed at Twitch, but this seems to have solved my issues.
Cheers,
Also, in TwitchIRC::fetchServerMessage() inside the
while (SocketActive()) {
loop I added
this_thread::sleep_for(chrono::milliseconds(5));
at the end to bring CPU usage down from 100%.