我正在使用Phredds Irc bot,因为我正在尝试为我的抽搐聊天做一个机器人.它连接和响应ping很好但它不会响应其他任何东西.我似乎正在做他在pastebin中所做的事情,所以这有什么问题?
import socket #imports module allowing connection to IRC
import threading #imports module allowing timing functions
#sets variables for connection to twitch chat
bot_owner = 'TwitchPlaysFightingGames'
nick = 'MagicalCakeBot'
channel = '#TwitchPlaysFightingGames'
server = 'irc.twitch.tv'
password = 'oauth:~redacted~'
queue = 0 #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 …
Run Code Online (Sandbox Code Playgroud) haskell新手,当我尝试模式匹配非空列表时,我一直遇到这个神秘的错误
码:
type Bits = [Bool]
nor :: Bits -> Bits -> Bits
nor [] [_:__] = error "mismatched length"
nor [_:__] [] = error "mismatched length"
nor [] [] = []
nor (x:xs) (y:ys) = (norBit x y):nor xs ys
where norBit x y = if x == True || y == True then False else True
main = do
print (nor [True] [False])
Run Code Online (Sandbox Code Playgroud)
错误:
gates.hs:4:9:
Couldn't match expected type ‘Bool’ with actual type ‘[t0]’
In the pattern: _ …
Run Code Online (Sandbox Code Playgroud)