Module Irc


module Irc: sig .. end
An IRC protocol analyser / synthesiser.

It also provides a nice OCaml module to make IRC clients or bots (see the Client module).
Author(s): Berke Durak, Samuel Mimram



Types



type mode =
| Add_channel_mode of string * channel_mode
| Remove_channel_mode of string * channel_mode
| Add_user_mode of user_mode * string
| Remove_user_mode of user_mode * string
Modes (for channels and users).

type channel_mode =
| Channel_mode_op of string
| Channel_mode_private
| Channel_mode_secret
| Channel_mode_invite_only
| Channel_mode_op_topic
| Channel_mode_no_outside_messages
| Channel_mode_moderated
| Channel_mode_user_limit of int
| Channel_mode_ban of string
| Channel_mode_voice of string
| Channel_mode_key
Modes of channels.

type user_mode =
| User_mode_invisible
| User_mode_server_notices
| User_mode_wallops
| User_mode_op
Modes of user.

type reply =
| Rpl_who
| Rpl_end_of_who
| Rpl_whois_channels
| Rpl_name_reply
| Rpl_MOTD_start
| Rpl_MOTD
| Rpl_end_of_MOTD
Type of a reply from the server.
type sender 
Sender of a message.

Useful functions


val string_of_sender : sender -> string
Get a string representation of a sender (it can be a servername, a nickname or an empty string).

Handling stupid mIrc color codes

The official color code list is


val filter_stupid_mirc_color_codes : string -> string
Remove color codes from a string.
val color_text : int -> string -> string
Set the foreground color of a text.
val bicolor_text : int -> int -> string -> string
Set the foreground and the background (arguments are in this order) colors of a text.
val bold_text : string -> string
Make a text in bold.
val underline_text : string -> string
Underline a text.
val reverse_text : string -> string
Make a text in reverse colors (white becomes black, etc).
val beep_text : unit -> string
Get a text which will make a bell sound (to use with moderation).

Client modules


module type Client_params = sig .. end
Parameters needed to create a client.
module Client: 
functor (P : Client_params) -> sig .. end
A basic client with callbacks but no elaborate event handler.