diff options
| author | Adelyn Breelove <[email protected]> | 2019-01-21 08:52:33 -0700 |
|---|---|---|
| committer | Adelyn Breelove <[email protected]> | 2019-01-21 08:52:33 -0700 |
| commit | c3d6e15bb89d4a93a2fa486db6c8e126baf4da2e (patch) | |
| tree | 3fe6679ff4520899bab9ab9fb96145efd614a3a3 /lib/models/channel/channel.mli | |
| parent | swap order of fields in example bot to reflect correct ordering (diff) | |
| download | disml-c3d6e15bb89d4a93a2fa486db6c8e126baf4da2e.tar.xz disml-c3d6e15bb89d4a93a2fa486db6c8e126baf4da2e.zip | |
folder restructure
Diffstat (limited to 'lib/models/channel/channel.mli')
| -rw-r--r-- | lib/models/channel/channel.mli | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/lib/models/channel/channel.mli b/lib/models/channel/channel.mli new file mode 100644 index 0000000..001bb05 --- /dev/null +++ b/lib/models/channel/channel.mli @@ -0,0 +1,44 @@ +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:Embed.t -> + ?content:string -> + ?file:string -> + ?tts:bool -> + t -> + Message_t.t Deferred.Or_error.t +val delete : t -> unit Deferred.Or_error.t +val get_message : id:Snowflake.t -> t -> Message_t.t Deferred.Or_error.t +val get_messages : + ?mode:[ `Before | `After | `Around ] -> + ?id:Snowflake.t -> + ?limit:int -> + t -> + Message_t.t list Deferred.Or_error.t +val broadcast_typing : t -> unit Deferred.Or_error.t +val get_pins : t -> Message_t.t list Deferred.Or_error.t +(* TODO more things related to guild channels *)
\ No newline at end of file |