aboutsummaryrefslogtreecommitdiff
path: root/lib/gateway/event.mli
diff options
context:
space:
mode:
authorAdelyn Breedlove <[email protected]>2019-02-11 17:23:59 +0000
committerAdelyn Breedlove <[email protected]>2019-02-11 17:23:59 +0000
commit7c9b809078b5cd53e3d54c0004c683da2ec679af (patch)
tree5a1b165b597fc1ad4167115d9a23b12852a4636b /lib/gateway/event.mli
parentMerge branch 'sharder_fixes' into 'master' (diff)
downloaddisml-7c9b809078b5cd53e3d54c0004c683da2ec679af.tar.xz
disml-7c9b809078b5cd53e3d54c0004c683da2ec679af.zip
Add a cache
Diffstat (limited to 'lib/gateway/event.mli')
-rw-r--r--lib/gateway/event.mli49
1 files changed, 49 insertions, 0 deletions
diff --git a/lib/gateway/event.mli b/lib/gateway/event.mli
new file mode 100644
index 0000000..4db3c84
--- /dev/null
+++ b/lib/gateway/event.mli
@@ -0,0 +1,49 @@
+(** Barebones of event dispatching. Most users will have no reason to look here. *)
+
+open Event_models
+
+(** Event dispatch type wrapper. Used internally. *)
+type t =
+| READY of Ready.t
+| RESUMED of Resumed.t
+| CHANNEL_CREATE of ChannelCreate.t
+| CHANNEL_UPDATE of ChannelUpdate.t
+| CHANNEL_DELETE of ChannelDelete.t
+| CHANNEL_PINS_UPDATE of ChannelPinsUpdate.t
+| GUILD_CREATE of GuildCreate.t
+| GUILD_UPDATE of GuildUpdate.t
+| GUILD_DELETE of GuildDelete.t
+| GUILD_BAN_ADD of GuildBanAdd.t
+| GUILD_BAN_REMOVE of GuildBanRemove.t
+| GUILD_EMOJIS_UPDATE of GuildEmojisUpdate.t
+(* | GUILD_INTEGRATIONS_UPDATE of Yojson.Safe.t *)
+| GUILD_MEMBER_ADD of GuildMemberAdd.t
+| GUILD_MEMBER_REMOVE of GuildMemberRemove.t
+| GUILD_MEMBER_UPDATE of GuildMemberUpdate.t
+| GUILD_MEMBERS_CHUNK of GuildMembersChunk.t
+| GUILD_ROLE_CREATE of GuildRoleCreate.t
+| GUILD_ROLE_UPDATE of GuildRoleUpdate.t
+| GUILD_ROLE_DELETE of GuildRoleDelete.t
+| MESSAGE_CREATE of MessageCreate.t
+| MESSAGE_UPDATE of MessageUpdate.t
+| MESSAGE_DELETE of MessageDelete.t
+| MESSAGE_DELETE_BULK of MessageDeleteBulk.t
+| REACTION_ADD of ReactionAdd.t
+| REACTION_REMOVE of ReactionRemove.t
+| REACTION_REMOVE_ALL of ReactionRemoveAll.t
+| PRESENCE_UPDATE of PresenceUpdate.t
+| TYPING_START of TypingStart.t
+| USER_UPDATE of UserUpdate.t
+(* | VOICE_STATE_UPDATE of Yojson.Safe.t *)
+(* | VOICE_SERVER_UPDATE of Yojson.Safe.t *)
+| WEBHOOK_UPDATE of WebhookUpdate.t
+| UNKNOWN of Unknown.t
+
+(** Used to convert an event string and payload into a t wrapper type. *)
+val event_of_yojson : contents:Yojson.Safe.t -> string -> t
+
+(** Sends the event to the registered handler. *)
+val dispatch : t -> unit
+
+(** Wrapper to other functions. This is called from the shards. *)
+val handle_event : ev:string -> Yojson.Safe.t -> unit \ No newline at end of file