Advertisement
Guest User

Untitled

a guest
Jan 21st, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. import socket
  2. from config import HOST, PORT, CHANNEL
  3.  
  4. # User Info
  5. USER = "straussbot" # The bots username
  6. PASS = "oauth:sj175lp884ji5c9las089sm9vvaklf" # The auth code
  7.  
  8. class StraussBot:
  9. def __init__(self):
  10. self.Ssock = socket.socket()
  11.  
  12. def connectSock(self):
  13. self.Ssock.connect((HOST, PORT))
  14. self.Ssock.send(str("Pass " + PASS + "rn").encode('UTF-8'))
  15. self.Ssock.send(str("NICK " + USER + "rn").encode('UTF-8'))
  16. self.Ssock.send(str("JOIN " + CHANNEL + "rn").encode('UTF-8'))
  17.  
  18. if __name__ == "__main__":
  19. print "Starting the bot..."
  20. while True:
  21. straussbot = StraussBot
  22. try:
  23. straussbot.connectSock()
  24. except Exception as e:
  25. print e
  26.  
  27. straussbot = StraussBot
  28.  
  29. straussbot = StraussBot()
  30.  
  31. straussbot = StraussBot
  32.  
  33. straussbot = StraussBot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement