You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.3 KiB

open Irc_client
open Lwt
(** We distinguish between "big channels" (allowed to spam) and "smol channels" (shouldn't spam).
Thanks to nilaky for the terminology. *)
module Conn (C: CLIENT with type 'a Io.t = 'a Lwt.t) : sig
type t = C.connection_t
val smolchannels : string list ref
val bigchannels : string list ref
val send_msg : t -> is_big:bool -> ?channel:string -> string -> unit Lwt.t
(** Send a message to all the channels associated with the connection.
set `is_big` (default: false) if the message is for `big channels` only.
If `channel` is specified then send to that channel only. *)
val join_chan : t -> is_big:bool -> channel:string -> unit Lwt.t
(** Join a channel with and add it to the list. `is_big` default to false. *)
val register_callback :
prefix:string ->
callback:(t -> string -> string -> string -> unit Lwt.t) ->
(** Register a callback for the prefix "!<prefix>". The arguments for
the callback are: connection nick (possible empty), channel, the rest of the
message. *)
val pls_connect :
realname:string ->
username:string ->
server:string ->
port:int ->
nick:string ->
logf:(string -> unit Lwt.t) ->
onconnect:(t -> unit Lwt.t) ->
unit Lwt.t