title: IRC Bot - flood protection (python)
body: <pre><code>  if data.find('PRIVMSG') != -1:
       nick = data.split('!')[ 0 ].replace(':','')
       text = ''
       if data.count(text) &gt;= 200:
          sck.send('KICK ' + " " + chan + " :" 'flooding' + '\r\n')
  </code></pre>
  
  <p>I'm trying to code a flood protection for the bot, I want it to kick a user if he enters more then 200 characters, how can I make it so it can read the other lines instead of just the first line? and the code above doesn't work, it doesnt kick the user but if I change the <code>sck.send()</code> to <code>sck.send('PRIVMSG ' + chan + " :" 'flooding' + '\r\n')</code> it works.</p>
  
  <p>fixed the kicking problem, and the code works now, but it only reads the first line, not sure how to make it read the other lines if the user keeps flooding the channel.</p>
  
  <pre><code>  if data.find('PRIVMSG') != -1:
       nick = data.split('!')[ 0 ].replace(':','')
       text = ''
       if data.count(text) &gt;= 200:
          sck.send('KICK ' + " " + chan + " " + nick + " :" 'flooding' + '\r\n')
  </code></pre>