irc-fun-bot-0.3.0.0: Library for writing fun IRC bots.

Safe HaskellNone
LanguageHaskell2010

Network.IRC.Fun.Bot

Description

This module allows you to define bot event handlers and commands, and then just run event source and sink threads in your main function and let them handle all the details.

Synopsis

Documentation

runBot Source

Arguments

:: Config

IRC connection configuration

-> [EventMatcher e s]

Event detection (high-to-low priority)

-> Behavior e s

Behavior definition for IRC events

-> [EventSource e s a]

Additional event source threads to run

-> EventHandler e s a

Handler for events coming from those sources

-> e

Custom bot environment (read-only state)

-> s

Initial state to hold in the background

-> Session e s ()

Initialization action to run at the very beginning of the session

-> IO () 

Start the bot and run its event loop. The bot will listen to messages from the IRC server and other provided sources, and will respond according to the behavior definitions.