aboutsummaryrefslogtreecommitdiff
path: root/lib/models/channel.mli
diff options
context:
space:
mode:
Diffstat (limited to 'lib/models/channel.mli')
-rw-r--r--lib/models/channel.mli24
1 files changed, 23 insertions, 1 deletions
diff --git a/lib/models/channel.mli b/lib/models/channel.mli
index 6ca814e..001bb05 100644
--- a/lib/models/channel.mli
+++ b/lib/models/channel.mli
@@ -1,9 +1,31 @@
open Async
include module type of Channel_t
+exception Invalid_message
+exception No_message_found
+
+(** Simple version of send_message that only takes [~content] *)
val say : content:string -> t -> Message_t.t Deferred.Or_error.t
+
+(** Advanced message sending.
+
+ Raises {!Channel.Invalid_message} if one of content or embed is not set.
+
+ {3 Examples}
+ {[
+ open Core
+ open Disml
+
+ let check_command (msg : Message.t) =
+ if String.is_prefix ~prefix:"!hello" msg.content then
+ let embed = { Embed.default with title = Some "Hello World!" } in
+ Channel.send_message ~embed msg.channel >>> ignore
+
+ Client.message_create := check_command
+ ]}
+*)
val send_message :
- ?embed:Yojson.Safe.json ->
+ ?embed:Embed.t ->
?content:string ->
?file:string ->
?tts:bool ->