Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
445
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. if botlib.check_found(self.data, "PRIVMSG "):
  2. for line in self.data.split('\n\r'):
  3. print "<debug>%s</debug>" % line
  4. message = ':'.join(line.split(':')[2:]) # Split the command from the message
  5. nick = line.split('!')[ 0 ].replace(':',' ') # The nick of the user issueing the command is taken from the hostname
  6. nick = nick.lstrip()
  7. destination = ''.join (line.split(':')[:2]).split (' ')[-2] # Destination is taken from the data
  8. command = message.split( )[0] # The command is first element of the message split
  9.  
  10.  
  11.  
  12. output from debug is:
  13. <debug>:wicky!wicky@somehost.com PRIVMSG #pastie :!pastie
  14. </debug>
  15. <debug>:wicky!wicky@somehost.com PRIVMSG #pastie :line1
  16. </debug>
  17. <debug>:wicky!wicky@somehost.com PRIVMSG #pastie :line2
  18. :wicky!wicky@somehost.com PRIVMSG #pastie :line3
  19. </debug>
  20. <debug>:wicky!wicky@somehost.com PRIVMSG #pastie :line4
  21. :wicky!wicky@somehost.com PRIVMSG #pastie :line5
  22. </debug>
  23. <debug>:wicky!wicky@somehost.com PRIVMSG #pastie :line6
  24. </debug>
  25. <debug>:wicky!wicky@somehost.com PRIVMSG #pastie :line7
  26. </debug>
  27. <debug>:wicky!wicky@somehost.com PRIVMSG #pastie :line8
  28. </debug>
  29. <debug>:wicky!wicky@somehost.com PRIVMSG #pastie :!end
  30. </debug>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement