diff options
| author | Adelyn Breedlove <[email protected]> | 2019-01-19 15:58:31 -0700 |
|---|---|---|
| committer | Adelyn Breedlove <[email protected]> | 2019-01-19 15:58:31 -0700 |
| commit | b678d7312518bb0ff74d7db364bcbbcded5c1609 (patch) | |
| tree | 39094fc179c33fc67269ffc3fea218384c558cfe /lib/models/channel.mli | |
| parent | update docs export (diff) | |
| download | disml-b678d7312518bb0ff74d7db364bcbbcded5c1609.tar.xz disml-b678d7312518bb0ff74d7db364bcbbcded5c1609.zip | |
more updates
Diffstat (limited to 'lib/models/channel.mli')
| -rw-r--r-- | lib/models/channel.mli | 24 |
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 -> |