summaryrefslogtreecommitdiff
path: root/Hsbot/Core.hs
diff options
context:
space:
mode:
authorJulien Dessaux2009-08-06 00:11:14 +0200
committerJulien Dessaux2009-08-06 00:11:14 +0200
commitb9c8e4d404c444d57fe7320c25ba0654d9c5193c (patch)
tree98796cc7cf2b74b51feaf6214c5b1ae8c49688d8 /Hsbot/Core.hs
parentrenamed "Server" algebraic data type to "IrcServer" (diff)
downloadhsbot-b9c8e4d404c444d57fe7320c25ba0654d9c5193c.tar.gz
hsbot-b9c8e4d404c444d57fe7320c25ba0654d9c5193c.tar.bz2
hsbot-b9c8e4d404c444d57fe7320c25ba0654d9c5193c.zip
Added IRC connection and initialisation stuff.
Diffstat (limited to 'Hsbot/Core.hs')
-rw-r--r--Hsbot/Core.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Hsbot/Core.hs b/Hsbot/Core.hs
index b2e34c8..4daeef9 100644
--- a/Hsbot/Core.hs
+++ b/Hsbot/Core.hs
@@ -3,10 +3,12 @@ module Hsbot.Core
, Config(..)
, IrcServer(..)
, newbot
+ , sendstr
) where
import qualified Data.Map as M
import System.IO (Handle)
+import Text.Printf (hPrintf)
-- | An IRC Bot server state (socket handles)
data Bot = Bot
@@ -34,3 +36,6 @@ data IrcServer = IrcServer
newbot :: Bot
newbot = Bot (M.empty)
+-- | Send a string over handle
+sendstr handle str = hPrintf handle "%s\r\n" str
+