aboutsummaryrefslogtreecommitdiff
path: root/lib/cache.mli
diff options
context:
space:
mode:
authorAdelyn Breelove <[email protected]>2019-02-19 08:45:12 -0700
committerAdelyn Breelove <[email protected]>2019-02-19 08:45:12 -0700
commit3d3943ce13a3379969a1478f10e6741162813744 (patch)
tree3451bf7a5917e68b1bddb8d48765fdc495d39b0a /lib/cache.mli
parentChange channel.t to use more flexible variant (diff)
downloaddisml-3d3943ce13a3379969a1478f10e6741162813744.tar.xz
disml-3d3943ce13a3379969a1478f10e6741162813744.zip
add cache helper methods
Diffstat (limited to 'lib/cache.mli')
-rw-r--r--lib/cache.mli44
1 files changed, 43 insertions, 1 deletions
diff --git a/lib/cache.mli b/lib/cache.mli
index 1909303..24a8a1b 100644
--- a/lib/cache.mli
+++ b/lib/cache.mli
@@ -34,4 +34,46 @@ val cache : t Mvar.Read_write.t
val create :
(* ?max_messages:int -> *)
unit ->
- t \ No newline at end of file
+ t
+
+(** Equivalent to {!GuildMap.find} on cache.guilds. *)
+val guild :
+ t ->
+ Guild_id_t.t ->
+ Guild_t.t option
+
+(** Equivalent to {!ChannelMap.find} on cache.text_channels. *)
+val text_channel :
+ t ->
+ Channel_id_t.t ->
+ Channel_t.guild_text option
+
+(** Equivalent to {!ChannelMap.find} on cache.voice_channels. *)
+val voice_channel :
+ t ->
+ Channel_id_t.t ->
+ Channel_t.guild_voice option
+
+(** Equivalent to {!ChannelMap.find} on cache.categories. *)
+val category :
+ t ->
+ Channel_id_t.t ->
+ Channel_t.category option
+
+(** Equivalent to {!ChannelMap.find} on cache.private_channels. *)
+val dm :
+ t ->
+ Channel_id_t.t ->
+ Channel_t.dm option
+
+(** Equivalent to {!ChannelMap.find} on cache.groups. *)
+val group :
+ t ->
+ Channel_id_t.t ->
+ Channel_t.group option
+
+(** Helper method that scans all channel stores and returns a {!Channel.t} holding the channel. *)
+val channel :
+ t ->
+ Channel_id_t.t ->
+ Channel_t.t option \ No newline at end of file