我正在将Twitch机器人从Python2.7移到Python3.5。我不断地发现错误:
a bytes like object is required not 'str'
在下面代码的第二行。
twitchdata = irc.recv(1204)
data = twitchdata.split(":")[1]
twitchuser = data.split("!")[0]
twitchmsg = twitchdata.split(":")[2]
chat = str(twitchuser) +": "+ str(twitchmsg)
print(chat) #prints chat to console
试试看
而不是
相关问题 更多 >
编程相关推荐