more debug print, disable evalScheme temporarily

master
opfez 2021-12-17 20:47:42 +01:00
parent 0adf019d45
commit 7cf64b433f
1 changed files with 5 additions and 3 deletions

View File

@ -40,7 +40,7 @@ listen = forever $ do
line <- liftIO $ hGetLine h line <- liftIO $ hGetLine h
let tokens = words line let tokens = words line
-- Debug print -- Debug print
liftIO $ putStrLn line liftIO $ putStrLn $ "< " ++ line
tokenDispatch (parseUser $ tail line) (parseChannel tokens) tokens tokenDispatch (parseUser $ tail line) (parseChannel tokens) tokens
where parseUser str = username where parseUser str = username
where username = getName str where username = getName str
@ -75,7 +75,7 @@ tokenDispatch (Just username) (Just chn) ts = if elem "PRIVMSG" ts
"!tz" -> if "!tz" == last tokens "!tz" -> if "!tz" == last tokens
then timezone chn username then timezone chn username
else timezone chn $ head $ tail tokens else timezone chn $ head $ tail tokens
"!eval" -> evalScheme chn $ join $ intersperse " " $ tail tokens -- "!eval" -> evalScheme chn $ join $ intersperse " " $ tail tokens
"!rollcall" -> rollcall chn "!rollcall" -> rollcall chn
"!anna" -> anna chn "!anna" -> anna chn
_ -> return () _ -> return ()
@ -154,7 +154,9 @@ anna = rollcall
write :: String -> String -> Net () write :: String -> String -> Net ()
write cmd args = do write cmd args = do
h <- asks socket h <- asks socket
liftIO $ hPutStr h $ cmd ++ " " ++ args ++ "\r\n" liftIO $ hPutStr h $ output
liftIO $ putStr $ "> " ++ output
where output = cmd ++ " " ++ args ++ "\r\n"
sendNick :: Net () sendNick :: Net ()
sendNick = write "NICK" name sendNick = write "NICK" name