PhantomBot icon indicating copy to clipboard operation
PhantomBot copied to clipboard

Rate limiting in 2022

Open hippyau opened this issue 2 years ago • 1 comments

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,

hippyau avatar Aug 26 '22 03:08 hippyau

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%.

hippyau avatar Aug 26 '22 06:08 hippyau