module Irc_message:sig
..end
type
command =
| |
PASS of |
|||
| |
NICK of |
|||
| |
USER of |
(* |
see rfc
| *) |
| |
OPER of |
(* |
name * password
| *) |
| |
MODE of |
(* |
nick * mode string
| *) |
| |
QUIT of |
(* |
quit message
| *) |
| |
SQUIT of |
(* |
server * comment
| *) |
| |
JOIN of |
(* |
channels * key list
| *) |
| |
JOIN0 |
(* |
join 0 (parts all channels)
| *) |
| |
PART of |
(* |
channels * comment
| *) |
| |
TOPIC of |
(* |
chan * topic
| *) |
| |
NAMES of |
(* |
channels
| *) |
| |
LIST of |
(* |
channels
| *) |
| |
INVITE of |
(* |
nick * chan
| *) |
| |
KICK of |
(* |
channels * nick * comment
| *) |
| |
PRIVMSG of |
(* |
target * message
| *) |
| |
NOTICE of |
(* |
target * message
| *) |
| |
PING of |
|||
| |
PONG of |
|||
| |
Other of |
(* |
other cases
| *) |
type
t = {
|
prefix : |
|
command : |
val pass : string -> t
val nick : string -> t
val user : username:string -> mode:int -> realname:string -> t
val oper : name:string -> pass:string -> t
val mode : nick:string -> mode:string -> t
val quit : msg:string option -> t
val join : chans:string list -> keys:string list option -> t
val join0 : t
val part : chans:string list -> comment:string option -> t
val topic : chan:string -> topic:string option -> t
val names : chans:string list -> t
val list : chans:string list -> t
val invite : nick:string -> chan:string -> t
val kick : chans:string list -> nick:string -> comment:string option -> t
val privmsg : target:string -> string -> t
val notice : target:string -> string -> t
val ping : string -> t
val pong : string -> t
val other : cmd:string -> params:string list -> t
val to_string : t -> string
val output : Pervasives.out_channel -> t -> unit
val write_buf : Buffer.t -> t -> unit
type'a
or_error =('a, string) Result.result
typeparse_result =
t or_error
exception ParseError of string * string
val parse : string -> t or_error
val parse_exn : string -> t
parse_exn s
returns the parsed messageParseError
if the string is not a proper messageval extract_prefix : string -> string option * string
val extract_trail : string -> string * string option