diff options
author | Julien Dessaux | 2010-05-16 00:01:00 +0200 |
---|---|---|
committer | Julien Dessaux | 2010-05-16 00:01:00 +0200 |
commit | c1662ba7b982a8502dc9f32031b7cb518df7f60e (patch) | |
tree | f00dbd9cb39bf0fbc20949105ea2b93d9e868070 /Plugins/Ping.hs | |
parent | Added the quote module. (diff) | |
download | hsbot-0.2.0.tar.gz hsbot-0.2.0.tar.bz2 hsbot-0.2.0.zip |
Rewrote nearly everything!v0.2.0
* Rewrote the whole architecture to achieve extreme modularity
* Added the ability to build a multiprotocol bot
* Added cabal integration
* Added configuration handling the XMonad style
* Added configuration in ~/.hsbot
* Refactored many many named and functions
* Refactored data structures
* Cleaned a big bunch of stuff
Diffstat (limited to '')
-rw-r--r-- | Plugins/Ping.hs | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/Plugins/Ping.hs b/Plugins/Ping.hs deleted file mode 100644 index 5da3f2f..0000000 --- a/Plugins/Ping.hs +++ /dev/null @@ -1,31 +0,0 @@ -module Plugins.Ping - ( mainPing - ) where - -import Control.Concurrent.Chan -import Control.Exception -import Control.Monad.State -import Prelude hiding (catch) - -import Hsbot.IRCPlugin -import Hsbot.Types - --- | The plugin's main entry point -mainPing :: Chan BotMsg -> Chan BotMsg -> IO () -mainPing serverChan chan = do - let plugin = PluginState "Ping" serverChan chan - _ <- (execStateT run plugin) `catch` (\(_ :: AsyncException) -> return plugin) - return () - --- | The IrcPlugin monad main function -run :: IrcPlugin () -run = forever $ do - msg <- readMsg - eval msg - where - eval :: BotMsg -> IrcPlugin () - eval (InputMsg msg) - | (command msg) == "PING" = writeMsg $ OutputMsg $ IrcMsg Nothing "PONG" (parameters msg) - | otherwise = return () - eval _ = return () - |