lambdabot-core-5.3.1.2: Lambdabot core functionality

Safe Haskell | None
Language | Haskell98

Lambdabot.IRC

Description

The IRC module processes the IRC protocol and provides a nice API for sending and receiving IRC messages with an IRC server.

Synopsis

- data IrcMessage = IrcMessage {
  - ircMsgServer :: !String
  - ircMsgLBName :: !String
  - ircMsgPrefix :: !String
  - ircMsgCommand :: !String
  - ircMsgParams :: ![String]
  }
- joinChannel :: Nick -> IrcMessage
- partChannel :: Nick -> IrcMessage
- getTopic :: Nick -> IrcMessage
- setTopic :: Nick -> String -> IrcMessage
- codepage :: String -> String -> IrcMessage
- privmsg :: Nick -> String -> IrcMessage
- quit :: String -> String -> IrcMessage
- timeReply :: IrcMessage -> IrcMessage
- pass :: String -> String -> IrcMessage
- user :: String -> String -> String -> String -> IrcMessage
- setNick :: Nick -> IrcMessage

# Documentation

data IrcMessage Source #

An IRC message is a server, a prefix, a command and a list of parameters.

Note that the strings here are treated as lists of bytes!

Constructors

IrcMessage |

Fields

- ircMsgServer :: !String
- ircMsgLBName :: !String
- ircMsgPrefix :: !String
- ircMsgCommand :: !String
- ircMsgParams :: ![String]

#### Instances

Instances details

Show IrcMessage Source # |
Instance details Defined in Lambdabot.IRC Methods showsPrec :: Int -> IrcMessage -> ShowS Source # show :: IrcMessage -> String Source # showList :: [IrcMessage] -> ShowS Source #
Message IrcMessage Source # |
Instance details Defined in Lambdabot.IRC Methods server :: IrcMessage -> String Source # nick :: IrcMessage -> Nick Source # fullName :: IrcMessage -> String Source # channels :: IrcMessage -> [Nick] Source # lambdabotName :: IrcMessage -> Nick Source #

joinChannel :: Nick -> IrcMessage Source #

partChannel :: Nick -> IrcMessage Source #

getTopic :: Nick -> IrcMessage Source #

setTopic :: Nick -> String -> IrcMessage Source #

codepage :: String -> String -> IrcMessage Source #

`codepage` creates a server CODEPAGE message. The input string given is the codepage name for current session.

privmsg Source #

Arguments

:: Nick | Who should receive the message (nick)
-> String | What is the message?
-> IrcMessage | Constructed message

`privmsg` creates a private message to the person designated.

quit :: String -> String -> IrcMessage Source #

`quit` creates a server QUIT message. The input string given is the quit message, given to other parties when leaving the network.

timeReply :: IrcMessage -> IrcMessage Source #

Construct a privmsg from the CTCP TIME notice, to feed up to the @localtime-reply plugin, which then passes the output to the appropriate client.

pass :: String -> String -> IrcMessage Source #

user :: String -> String -> String -> String -> IrcMessage Source #

setNick :: Nick -> IrcMessage Source #