package calculon

  1. Overview
  2. Docs

User-defined config

type hidden

Type that cannot be built

type t = {
  1. server : string;
    (*

    Address of the irc server

    *)
  2. port : int;
    (*

    Port of the server

    *)
  3. username : string;
  4. password : string option;
  5. realname : string;
  6. nick : string;
  7. tls : bool;
  8. sasl : bool;
  9. channels : string list;
    (*

    Channels to join after the connexion to the server

    *)
  10. log_level : Logs.level;
    (*

    Level of logging.

    • since 0.6
    *)
  11. prefix : string;
    (*

    prefix for commands

    *)
  12. db_file : string;
    (*

    Database path.

    • since NEXT_RELEASE
    *)
  13. _hidden : hidden;
    (*

    This field is present to prevent the user from using a literal record to build configuration. This way, adding new fields doesn't break existing code.

    • since NEXT_RELEASE
    *)
}

Bot configuration.

val default : t

Default configuration:

  • server = "irc.libera.chat"
  • port = 7000
  • username = "calculon"
  • realname = "calculon"
  • password = None
  • nick = "calculon"
  • tls = true
  • sasl = true
  • channel = "#ocaml"
  • irc_log = `None
  • log_level = Logs.Warning
  • prefix = "!"
  • db_file = "calculon.db"
val parse : ?extra_args:(string * Stdlib.Arg.spec * string) list -> t -> string array -> t

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

  • parameter extra_args

    additional command line arguments for Arg (since NEXT_RELEASE)

val of_argv : ?extra_args:(string * Stdlib.Arg.spec * string) list -> unit -> t

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

  • parameter extra_args

    additional command line arguments for Arg (since NEXT_RELEASE)

OCaml

Innovation. Community. Security.