Library
Module
Module type
Parameter
Class
Class type
type privmsg = {
nick : string;
author: nick
*)to_ : string;
target: nick or chan
*)message : string;
actual content
*)}
A message sent on some IRC channel, or in query. The message content is message
, its sender is nick
(a nickname), and its target is to_
(either a nickname for private messages, or a channel name).
val reply_to : privmsg -> string
find whom to reply to. If the message is in query, that is, not (is_chan msg.to_)
, then reply to msg.nick
; otherwise reply on the channel msg.to_
.
val nick : privmsg -> string
The author of the message
val string_of_privmsg : privmsg -> string
module type S = sig ... end
type t = (module S)
val loop_ssl :
?conn_info:string ->
connect:(unit -> Irc_client_lwt_ssl.connection_t option Lwt.t) ->
init:(t -> unit Lwt.t) ->
unit ->
unit Lwt.t
Feed this to Lwt_main.run
. It will connect using connect
(which opens a TLS connection), create a new core object (of type t
), call init
on this core object (to initialize plugins, etc.) then loop on incoming messages. If the connection is closed for any reason, this will wait for some time and then re-connect and call init
again, etc.
val loop_unsafe :
?conn_info:string ->
connect:(unit -> Irc_client_lwt.connection_t option Lwt.t) ->
init:(t -> unit Lwt.t) ->
unit ->
unit Lwt.t
Feed to Lwt_main.run
. Same as loop_tls
but with a cleartext connection (boo!).
Main entry point: use config to pick the connection method, then call the appropriate auto-reconnection loop. Calls init
every time a new connection is opened.
Logging
Logger using logs_src
.