package calculon

  1. Overview
  2. Docs

User-defined config

type irc_log = [
  1. | `None
  2. | `Chan of Lwt_io.output_channel
  3. | `Custom of string -> unit Lwt.t
]
type t = {
  1. server : string;
    (*

    Address of the irc server

    *)
  2. port : int;
    (*

    Port of the server

    *)
  3. username : string;
  4. realname : string;
  5. nick : string;
  6. tls : bool;
  7. tls_cert : Ssl.certificate option;
  8. channel : string;
    (*

    Channel to join after the connexion to the server

    *)
  9. state_file : string;
    (*

    Where plugins' state is stored

    *)
  10. irc_log : irc_log;
    (*

    Log IRC events

    *)
  11. prefix : string;
    (*

    prefix for commands

    *)
}
val default : t

Default configuration:

  • server = "irc.freenode.net"
  • port = 7000
  • username = "calculon"
  • realname = "calculon"
  • nick = "calculon"
  • tls = true
  • tls_cert = None
  • channel = "#ocaml"
  • state_file = "state.json"
  • irc_log = `None
  • prefix = "!"
val parse : t -> string array -> t

parse conf args is the same as conf, but some command line arguments can override its fields

val of_argv : unit -> t

Parsed from Sys.argv Will call exit if Arg.parse fails

OCaml

Innovation. Community. Security.