From 4657b2251d0a57e1059183807738d19b85ea9ea9 Mon Sep 17 00:00:00 2001 From: Laura Date: Mon, 16 Jan 2023 19:03:20 +0100 Subject: List command with associated dir structure change. --- miaowe.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'miaowe.hs') diff --git a/miaowe.hs b/miaowe.hs index 3778e23..6ee36c2 100644 --- a/miaowe.hs +++ b/miaowe.hs @@ -184,6 +184,8 @@ processCommand :: IrcChannel -> MircString -> IO () processCommand channel command | length (words command) < 5 = sendToChannel channel "You need to specify a command." | (words command)!!4 == "Quit" = exitSuccess + | (words command)!!4 == "List" = listDirectory "." + >>= sendToChannel channel . intercalate "\n" | otherwise = (if isInfixOf "/" ((words command)!!4) then sendToChannel channel @@ -201,7 +203,7 @@ mainLoop channel = waitForCommand main :: IO () main = - openFile "conf" ReadMode + openFile "../conf" ReadMode >>= (\handle -> hGetLine handle >>= putStr . ircConnect -- cgit v1.2.3