Advertisement
tyler569

Untitled

May 5th, 2014
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.63 KB | None | 0 0
  1. #!/usr/bin/python3
  2.  
  3. """
  4. Docstring + License Here
  5. """
  6.  
  7. import irc
  8. import threading
  9.  
  10. def ircRth(x):
  11.     for line in x.read_lines():
  12.         if line.nick is None:
  13.             line.nick = ""
  14.         if line.trail is None:
  15.             line.trail = ""
  16.         print(line.nick + ": " + line.trail)
  17.        
  18. def main():
  19.     CHANNEL = "#OREServerChat"
  20.     NICK = "t569-qtest"
  21.  
  22.     x = irc.client()
  23.     x.printing = False
  24.  
  25.     x.connect("irc.freenode.net", "tyler", "nightingale.vms.pw", "Tyler")
  26.     x.nick(NICK)
  27.     x.join(CHANNEL)
  28.    
  29.     t = threading.Thread(target=ircRth, args=(x,))
  30.     t.start()
  31.    
  32.     while True:
  33.         inp = input()
  34.         x.privmsg(CHANNEL, inp)
  35.    
  36. if __name__ == "__main__":
  37.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement