I'm creating an IRC bot in Python 3.3 which uses timers for several functions, including hangman and a TwitchPlaysPokemon-esqe button-pressing script. The problem is, while the bot is waiting for new server messages (line=s.recv(4096)), it completely ignores all timers. This would be fine if the bot were on a busy channel, however it's quite annoying when the channel is occupied by just the bot and myself, and maybe a few others idling, as it delays hangman and the democracy mode voting timers. How do I get the bot to move on when there is no message to receive, i.e. have the recv command return None?
Asked
Active
Viewed 85 times
0
-
Don't use blocking IO – Johannes Kuhn Mar 20 '14 at 10:18
-
Thanks, I also set a timeout period and handler which helped immensely. – PikalaxALT Mar 20 '14 at 21:25