Created
December 24, 2015 01:36
-
-
Save blizzarddreams/4d3cf8d8ecdd78a7423c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| channels = ["#test", "#world"] | |
| main = do | |
| conn <- connectTo (server bot) $ PortNumber $ fromIntegral $ 6667 | |
| hSetBuffering conn NoBuffering | |
| write conn "USER" $ nick bot ++ " 8 * :" ++ nick bot | |
| write conn "NICK" "haskelbottt" | |
| write conn "JOIN" "#botwars" -- instead I want to loop through channels and pass it AND conn to `write` | |
| listen conn | |
| write :: Handle -> String -> String -> IO () | |
| write h s t = do | |
| hPrintf h "%s %s\r\n" s t | |
| joinChannel :: Handle -> String -> IO () | |
| joinChannel c channel = | |
| write c "JOIN" channel |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment