3
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') 

Twitch チャット用のボットを作成しようとしていますが、このコードを実行するとエラーが表示されます I'm using someone elses code that works for them but not for me

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
4

1 に答える 1