python - IRC bot - Give voice to registered nicks -


i made irc bot, bot should give voice/+v registered users. can't figure out how?

if data.find(' join :' + channel) !=-1:             selfnick = data.split(":")[1].split("!")[0]             if selfnick != botnick:                     rawsend("whois :" + selfnick + "\r\n")                     reggetnick = "307 " + botnick + " " + selfnick + " :is registered nick"                     if data.find(reggetnick) !=-1:                             # mode #chan +v selfnick                      else:                             print ""             else:                     print "" 

thanks.

you shouldn't check data @ point, because know it's 1 contains " join :", rather " :is registered nick".

instead should wait iteration of whatever loop reads data, , see if message in there.

bear in mind won't come directly afterwards, because might have sent whois while other data still waiting read.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -