diff options
author | Laura <the-ceo-of-antifa@protonmail.com> | 2023-01-25 22:56:20 +0100 |
---|---|---|
committer | Laura <the-ceo-of-antifa@protonmail.com> | 2023-01-25 22:56:20 +0100 |
commit | 115d223922eb50a371743ea2f384323278888f9c (patch) | |
tree | 1f4f3a88c25b58533e7841eacda25fa9cc6289e5 | |
parent | 468b3c649325de247d502afecd6d50f61d92d261 (diff) | |
download | miaowe-115d223922eb50a371743ea2f384323278888f9c.tar.gz miaowe-115d223922eb50a371743ea2f384323278888f9c.zip |
Don't allow commands from PM to spam channel
-rw-r--r-- | miaowe.hs | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -257,10 +257,15 @@ processCommand channel command | length (words command) < 5 = sendToChannel chan a command." | otherwise = doCommand channel command +commandChannel :: String -> String +commandChannel command = (words command)!!2 + mainLoop :: IrcChannel -> IO () mainLoop channel = waitForCommand >>= \line -> - processCommand channel line + (if commandChannel line == channel + then processCommand channel line + else return ()) >> mainLoop channel |