SHARE
TWEET

Untitled

a guest Jul 17th, 2017 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. TypeError: Can't convert 'bytes' object to str implicitly
  2.    
  3. irc.send("USER " + nick.encode() + " " + nick.encode() + " " + nick.encode() + " : Testn")
  4.    
  5. import sys
  6. import socket
  7.  
  8. server = "chat.freenode.net"
  9. channel = "#randomchannel123456789"
  10. port = 7070
  11.  
  12. print("IRC Connecter")
  13. print("-----------------------------")
  14. nick = input("Input Nickname: ")
  15.  
  16. irc = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  17. print("connecting to " + server)
  18.  
  19. irc.connect((server, port))
  20. print("connected")
  21.  
  22. irc.send("USER " + nick.encode() + " " + nick.encode() + " " + nick.encode() + " : Testn")
  23. print("sent user")
  24.  
  25. irc.send ("NICK " + nick + "n")
  26. print("sent nick")
  27.  
  28. while 1:
  29.    text = irc.recv(2040)
  30.    print(text)
  31.  
  32.    if text.find("PING") != -1:
  33.       irc.send("PONG " + text.split() [1] + "rn")
RAW Paste Data
Top