diff options
author | Laura <the-ceo-of-antifa@protonmail.com> | 2023-01-16 18:30:05 +0100 |
---|---|---|
committer | Laura <the-ceo-of-antifa@protonmail.com> | 2023-01-16 18:30:05 +0100 |
commit | 028a7662ca1c8f51859fbf9f7c54f80c290eff58 (patch) | |
tree | 1f5dd42d989147b5861bc09a64cec4f7c27a195d | |
parent | 2fe747d2ca7287855adb608dbef38697549a7720 (diff) | |
download | miaowe-028a7662ca1c8f51859fbf9f7c54f80c290eff58.tar.gz miaowe-028a7662ca1c8f51859fbf9f7c54f80c290eff58.zip |
Don't crash on empty command
-rw-r--r-- | miaowe.hs | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -181,7 +181,9 @@ trySendFile channel path = (doesFileExist (path) >> hFlush stdout)) processCommand :: IrcChannel -> MircString -> IO () -processCommand channel command | (words command)!!4 == "Quit" = exitSuccess +processCommand channel command | length (words command) < 5 = sendToChannel channel + "You need to specify a command." + | (words command)!!4 == "Quit" = exitSuccess | otherwise = (if isInfixOf "/" ((words command)!!4) then sendToChannel channel |