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
let tokens = words line
-- Debug print
liftIO $ putStrLn line
liftIO $ putStrLn $ "< " ++ line
tokenDispatch (parseUser $ tail line) (parseChannel tokens) tokens
where parseUser str = username
where username = getName str
@ -75,7 +75,7 @@ tokenDispatch (Just username) (Just chn) ts = if elem "PRIVMSG" ts
"!tz" -> if "!tz" == last tokens
then timezone chn username
else timezone chn $ head $ tail tokens
"!eval" -> evalScheme chn $ join $ intersperse " " $ tail tokens
-- "!eval" -> evalScheme chn $ join $ intersperse " " $ tail tokens
"!rollcall" -> rollcall chn
"!anna" -> anna chn
_ -> return ()
@ -154,7 +154,9 @@ anna = rollcall
write :: String -> String -> Net ()
write cmd args = do
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 = write "NICK" name