Advertisement
Guest User

Untitled

a guest
Feb 1st, 2017
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. import socket #imports module allowing connection to IRC
  2. import threading #imports module allowing timing functions
  3.  
  4. #sets variables for connection to twitch chat
  5. bot_owner = 'fullmetalbambi' #Anything - Irgendwas..
  6. nick = 'ericboy1555' #Bot Name
  7. channel = '#fullmetalbambi' #Stream Channel
  8. server = '199.9.250.229' #IRC Server
  9. password = 'oauth:rvfak44ye2pugu44ox3wka55760lriv' #Password (oAuth) - twitch token
  10.  
  11. queue = 13 #sets variable for anti-spam queue functionality
  12.  
  13. irc = socket.socket()
  14. irc.connect((server, 6667)) #connects to the server
  15.  
  16. #sends variables for connection to twitch chat
  17. irc.send('PASS ' + password + '\r\n')
  18. irc.send('USER ' + nick + ' 0 * :' + bot_owner + '\r\n')
  19. irc.send('NICK ' + nick + '\r\n')
  20. irc.send('JOIN ' + channel + '\r\n')
  21.  
  22.  
  23. while True:
  24. babadata = irc.recv(1204) #gets output from IRC server
  25. babauser = babadata.split(':')[1]
  26. babauser = babauser.split('!')[0] #determines the sender of the messages
  27. print babadata
  28.  
  29. if babadata.find('PING') != -1:
  30. irc.send(babadata.replace('PING', 'PONG')) #responds to PINGS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement