Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if botlib.check_found(self.data, "PRIVMSG "):
- for line in self.data.split('\n\r'):
- print "<debug>%s</debug>" % line
- message = ':'.join(line.split(':')[2:]) # Split the command from the message
- nick = line.split('!')[ 0 ].replace(':',' ') # The nick of the user issueing the command is taken from the hostname
- nick = nick.lstrip()
- destination = ''.join (line.split(':')[:2]).split (' ')[-2] # Destination is taken from the data
- command = message.split( )[0] # The command is first element of the message split
- output from debug is:
- <debug>:wicky!wicky@somehost.com PRIVMSG #pastie :!pastie
- </debug>
- <debug>:wicky!wicky@somehost.com PRIVMSG #pastie :line1
- </debug>
- <debug>:wicky!wicky@somehost.com PRIVMSG #pastie :line2
- :wicky!wicky@somehost.com PRIVMSG #pastie :line3
- </debug>
- <debug>:wicky!wicky@somehost.com PRIVMSG #pastie :line4
- :wicky!wicky@somehost.com PRIVMSG #pastie :line5
- </debug>
- <debug>:wicky!wicky@somehost.com PRIVMSG #pastie :line6
- </debug>
- <debug>:wicky!wicky@somehost.com PRIVMSG #pastie :line7
- </debug>
- <debug>:wicky!wicky@somehost.com PRIVMSG #pastie :line8
- </debug>
- <debug>:wicky!wicky@somehost.com PRIVMSG #pastie :!end
- </debug>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement