import time
import win32api, win32con
import socket #imports module allowing connection to IRC
import threading #imports module allowing timing functions
#sets variables for connection to twitch chat
bot_owner = 'TheMagicalCake'
nick = 'MagicalCakeBot'
channel = '#TheMagicalCake'
server = 'magicalcakebot.jtvirc.com'
password = '~redacted~'
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')
我正在尝试为抽搐聊天制作一个机器人,但是当我运行此代码时,我收到错误消息,我正在使用适用于他们但不适用于我的其他人的代码
Traceback (most recent call last):
File "C:/Users/Owner/Desktop/TheMagicalCake", line 47, in <module>
irc.connect((server, 6667)) #connects to the server
File "C:\Python27\lib\socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
gaierror: [Errno 11004] getaddrinfo failed