aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAdelyn Breelove <[email protected]>2019-01-31 13:30:49 -0700
committerAdelyn Breelove <[email protected]>2019-01-31 13:30:49 -0700
commite97037d486983c0fd5c5d892f8ade509e9bfee33 (patch)
treec99238572dd07b0f383ce6de26e0a30df726772a /lib
parentFix message update deserialize (diff)
downloaddisml-e97037d486983c0fd5c5d892f8ade509e9bfee33.tar.xz
disml-e97037d486983c0fd5c5d892f8ade509e9bfee33.zip
Add entry point doc stuff
Diffstat (limited to 'lib')
-rw-r--r--lib/disml.ml76
1 files changed, 76 insertions, 0 deletions
diff --git a/lib/disml.ml b/lib/disml.ml
index c7c4c34..922a4d3 100644
--- a/lib/disml.ml
+++ b/lib/disml.ml
@@ -1,24 +1,100 @@
+(**
+ {2 Dis.ml - An OCaml wrapper for the Discord API}
+
+ {3 Example}
+
+ {[
+ 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 ()
+ ]}
+*)
+
+(** The primary interface for connecting to Discord and handling gateway events. *)
module Client = Client
+
+(** Raw HTTP abstractions for Discord's REST API. *)
module Http = Http
+
+(** Gateway connection and sharding manager. *)
module Sharder = Sharder
+(** Super module for all Discord object types. *)
module Models = struct
+
+ (** Represents a user's activity. *)
module Activity = Activity
+
+ (** Represents a message attachment. *)
module Attachment = Attachment
+
+ (** Represents a ban object. *)
module Ban = Ban
+
+ (** Represents a full channel object. *)
module Channel = Channel
+
+ (** Represents solely a channel ID. REST operations can be performed without the full object overhead using this. *)
module Channel_id = Channel_id
+
+ (** Represents an embed object. *)
module Embed = Embed
+
+ (** Represents an emoji, both custom and unicode. *)
module Emoji = Emoji
+
+ (** Represents a guild object, also called a server. *)
module Guild = Guild
+
+ (** Represents solely a guild ID. REST operations can be performed without the full object overhead using this. *)
module Guild_id = Guild_id
+
+ (** Represents a user in the context of a guild. *)
module Member = Member
+
+ (** Represents a message object in any channel. *)
module Message = Message
+
+ (** Represents solely a message ID. REST operations can be performed without the full object overhead using this. *)
+ module Message_id = Message_id
+
+ (** Represents a user presence. See {!Models.Event.PresenceUpdate}. *)
module Presence = Presence
+
+ (** Represents an emoji used to react to a message. *)
module Reaction = Reaction
+
+ (** Represents a role object. *)
module Role = Role
+
+ (** Represents solely a role ID. REST operations can be performed without the full object overhead using this. *)
+ module Role_id = Role_id
+
+ (** Represents a Discord ID. *)
module Snowflake = Snowflake
+
+ (** Represents a user object. *)
module User = User
+
+ (** Represents solely a user ID. REST operations can be performed without the full object overhead using this. *)
+ module User_id = User_id
+ (** Represents the structures received over the gateway. *)
module Event = Event_models
end \ No newline at end of file