Module Disml - An OCaml wrapper for the Discord API


    open Async
    open Core
    open Disml
    open Models

    (* Create a function to handle message_create. *)
    let check_command (Event.MessageCreate.{message}) =
        if String.is_prefix ~prefix:"!ping" message.content then
            Message.reply message "Pong!" >>> ignore

    let main () =
        (* Register the event handler *)
        Client.message_create := check_command;
        (* Start the client. It's recommended to load the token from an env var or other config file. *)
        Client.start "My token" >>> ignore

    let _ =
        (* Launch the Async scheduler. You must do this for anything to work. *)
        Scheduler.go_main ~main ()
module Client : sig ... end

The primary interface for connecting to Discord and handling gateway events.

module Cache : sig ... end
module Http : sig ... end

Raw HTTP abstractions for Discord's REST API.

module Sharder : sig ... end

Gateway connection and sharding manager.

module Models : sig ... end

Super module for all Discord object types.