· 4 years ago · Feb 12, 2021, 05:42 PM
1import socket
2import ssl
3
4
5def send(irc, message):
6 irc.send(bytes(message + '\r\n', 'UTF-8'))
7
8
9if __name__ == '__main__':
10 bot_username = 'matthewbotuser'
11 channel_name = '#matthewde'
12 oauth_token =
13
14 irc = socket.socket()
15
16 irc.connect(('irc.chat.twitch.tv', 6667))
17
18 send(irc, 'PASS oauth:' + oauth_token)
19 send(irc, 'NICK ' + bot_username)
20 send(irc, 'JOIN ' + channel_name)
21
22 while True:
23 data = irc.recv(1024)
24 print(data)
25