Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

c-cube/irky

Open more actions menu

Repository files navigation

Irky

A fork of irc-client focused on direct style IOs (unix and Eio).

build

License

MIT

Usage

Simple bot which connects to a channel, sends a message, and then logs all messages in that channel to stdout:

module C = Irky.Client

let host = ref "irc.libera.chat"
let port = ref 6667
let nick = ref "irkytest"
let channel = ref "##demo_irc"

let on_msg _client msg =
  Printf.printf "Got message: %s\n%!" (Irky.Message.to_string msg)

let() =
  let io = Irky_unix.io in
  C.reconnect_loop ~reconnect_delay:15. ~io
    ~connect:(fun () ->
      C.connect_by_name ~server:!host ~port:!port ~nick:!nick ~io ())
    ~on_connect:(fun client ->
      Printf.printf "Connected, sending join for %S\n%!" !channel;
      C.send_join client ~channel:!channel;
      C.send_privmsg client ~target:!channel ~message:"hello from irky!")
    on_msg

Compile the above with:

ocamlfind ocamlopt -package irky -package irky.unix -linkpkg code.ml

Alternatively, you can find an extended version of this example in examples/example.ml; run it using dune exec -- examples/example.exe.

About

Simple direct-style IRC client for OCaml

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.