Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import socket #imports module allowing connection to IRC
- import threading #imports module allowing timing functions
- #sets variables for connection to twitch chat
- bot_owner = 'fullmetalbambi' #Anything - Irgendwas..
- nick = 'ericboy1555' #Bot Name
- channel = '#fullmetalbambi' #Stream Channel
- server = '199.9.250.229' #IRC Server
- password = 'oauth:rvfak44ye2pugu44ox3wka55760lriv' #Password (oAuth) - twitch token
- queue = 13 #sets variable for anti-spam queue functionality
- irc = socket.socket()
- irc.connect((server, 6667)) #connects to the server
- #sends variables for connection to twitch chat
- irc.send('PASS ' + password + '\r\n')
- irc.send('USER ' + nick + ' 0 * :' + bot_owner + '\r\n')
- irc.send('NICK ' + nick + '\r\n')
- irc.send('JOIN ' + channel + '\r\n')
- while True:
- babadata = irc.recv(1204) #gets output from IRC server
- babauser = babadata.split(':')[1]
- babauser = babauser.split('!')[0] #determines the sender of the messages
- print babadata
- if babadata.find('PING') != -1:
- irc.send(babadata.replace('PING', 'PONG')) #responds to PINGS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement