From b678d7312518bb0ff74d7db364bcbbcded5c1609 Mon Sep 17 00:00:00 2001 From: Adelyn Breedlove Date: Sat, 19 Jan 2019 15:58:31 -0700 Subject: more updates --- lib/models/channel.mli | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'lib/models/channel.mli') 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 -> -- cgit v1.2.3