小编The*_*ake的帖子

python中的IRC bot不会发送消息

我正在使用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)

python irc

5
推荐指数
1
解决办法
5893
查看次数

Haskell无法将预期类型'Bool'与类型[t0]匹配

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)

haskell types ghc

0
推荐指数
1
解决办法
103
查看次数

标签 统计

ghc ×1

haskell ×1

irc ×1

python ×1

types ×1