aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAdelyn Breelove <[email protected]>2018-12-14 15:09:23 -0700
committerAdelyn Breelove <[email protected]>2018-12-14 15:09:23 -0700
commit043d6adcaf557981f764ec1eb8c6400cc10f3eb8 (patch)
tree5b558c08dfb362fd50a6bdeed81e4776c4218779 /lib
parentWorking and pretty message replying! (diff)
downloaddisml-043d6adcaf557981f764ec1eb8c6400cc10f3eb8.tar.xz
disml-043d6adcaf557981f764ec1eb8c6400cc10f3eb8.zip
Improve endpoint module and add Message abstraction
Diffstat (limited to 'lib')
-rw-r--r--lib/endpoints.ml138
-rw-r--r--lib/models/message.ml46
-rw-r--r--lib/models/message.mli1
-rw-r--r--lib/s.ml218
4 files changed, 195 insertions, 208 deletions
diff --git a/lib/endpoints.ml b/lib/endpoints.ml
index 4fc2d1a..12563b0 100644
--- a/lib/endpoints.ml
+++ b/lib/endpoints.ml
@@ -1,96 +1,62 @@
+open Printf
+
let gateway = "/gateway"
let gateway_bot = "/gateway/bot"
-
-let channel channel_id = "/channels/"^channel_id
-let channel_messages channel_id = "/channels/"^channel_id^"/messages"
-
-let channel_message channel_id msg_id =
- "/channels/"^channel_id^"/messages/"^msg_id
-
-let channel_reaction_me channel_id msg_id emoji =
- "/channels/"^channel_id^"/messages/"^msg_id^"/reactions/"^emoji^"/@me"
-
-let channel_reaction channel_id msg_id emoji user_id =
- "/channels/"^channel_id^"/messages/"^msg_id^"/reactions/"^emoji^"/"^user_id
-
-let channel_reactions_get channel_id msg_id emoji =
- "/channels/"^channel_id^"/messages/"^msg_id^"/reactions/"^emoji
-
-let channel_reactions_delete channel_id msg_id =
- "/channels/"^channel_id^"/messages/"^msg_id^"/reactions"
-
-let channel_bulk_delete channel_id = "/channels/"^channel_id
-
-let channel_permission channel_id overwrite_id =
- "/channels/"^channel_id^"/permissions/"^overwrite_id
-
-let channel_permissions channel_id = "/channels"^channel_id^"/permissions"
+let channel = sprintf "/channels/%d"
+let channel_messages = sprintf "/channels/%d/messages"
+let channel_message = sprintf "/channels/%d/messages/%d"
+let channel_reaction_me = sprintf "/channels/%d/messages/%d/reactions/%s/@me"
+let channel_reaction = sprintf "/channels/%d/messages/%d/reactions/%s/%d"
+let channel_reactions_get = sprintf "/channels/%d/messages/%d/reactions/%s"
+let channel_reactions_delete = sprintf "/channels/%d/messages/%d/reactions"
+let channel_bulk_delete = sprintf "/channels/%d"
+let channel_permission = sprintf "/channels/%d/permissions/%d"
+let channel_permissions = sprintf "/channels/%d/permissions"
let channels = "/channels"
-let channel_call_ring channel_id = "/channels/"^channel_id^"/call/ring"
-let channel_invites channel_id = "/channels/"^channel_id^"/invites"
-let channel_typing channel_id = "/channels/"^channel_id^"/typing"
-let channel_pins channel_id = "/channels/"^channel_id^"/pins"
-let channel_pin channel_id msg_id = "/channels/"^channel_id^"/pins/"^msg_id
-
+let channel_call_ring = sprintf "/channels/%d/call/ring"
+let channel_invites = sprintf "/channels/%d/invites"
+let channel_typing = sprintf "/channels/%d/typing"
+let channel_pins = sprintf "/channels/%d/pins"
+let channel_pin = sprintf "/channels/%d/pins/%d"
let guilds = "/guilds"
-let guild guild_id = "/guilds/"^guild_id
-let guild_channels guild_id = "/guilds/"^guild_id^"/channels"
-let guild_members guild_id = "/guilds/"^guild_id^"/members"
-let guild_member guild_id user_id = "/guilds/"^guild_id^"/members/"^user_id
-
-let guild_member_role guild_id user_id role_id =
- "/guilds/"^guild_id^"/members/"^user_id^"/roles/"^role_id
-
-let guild_bans guild_id = "/guilds/"^guild_id^"/bans"
-let guild_ban guild_id user_id = "/guilds/"^guild_id^"/bans"^user_id
-let guild_roles guild_id = "/guilds/"^guild_id^"/roles"
-let guild_role guild_id role_id = "/guilds/"^guild_id^"/roles"^role_id
-let guild_prune guild_id = "/guilds/"^guild_id^"/prune"
-let guild_voice_regions guild_id = "/guilds/"^guild_id^"/regions"
-let guild_invites guild_id = "/guilds/"^guild_id^"/invites"
-let guild_integrations guild_id = "/guilds/"^guild_id^"/integrations"
-
-let guild_integration guild_id integration_id =
- "/guilds/"^guild_id^"/integrations/"^integration_id
-
-let guild_integration_sync guild_id integration_id =
- "/guilds/"^guild_id^"/integrations/"^integration_id^"/sync"
-
-let guild_embed guild_id = "/guilds/"^guild_id^"/embed"
-let guild_emojis guild_id = "/guilds/"^guild_id^"/emojis"
-let guild_emoji guild_id emoji_id = "/guilds/"^guild_id^"/emojis/"^emoji_id
-
-let webhooks_guild guild_id = "/guilds/"^guild_id^"/webhooks"
-let webhooks_channel channel_id = "/channels/"^channel_id^"/webhooks"
-let webhook webhook_id = "/webhooks/"^webhook_id
-let webhook_token webhook_id token = "/webhooks/"^webhook_id^"/"^token
-
-let webhook_git webhook_id token =
- "/webhooks/"^webhook_id^"/"^token^"/github"
-
-let webhook_slack webhook_id token =
- "/webhooks/"^webhook_id^"/"^token^"/slack"
-
-let user user_id = "/users/"^user_id
-
+let guild = sprintf "/guilds/%d"
+let guild_channels = sprintf "/guilds/%d/channels"
+let guild_members = sprintf "/guilds/%d/members"
+let guild_member = sprintf "/guilds/%d/members/%d"
+let guild_member_role = sprintf "/guilds/%d/members/%d/roles/%d"
+let guild_bans = sprintf "/guilds/%d/bans"
+let guild_ban = sprintf "/guilds/%d/bans/%d"
+let guild_roles = sprintf "/guilds/%d/roles"
+let guild_role = sprintf "/guilds/%d/roles/%d"
+let guild_prune = sprintf "/guilds/%d/prune"
+let guild_voice_regions = sprintf "/guilds/%d/regions"
+let guild_invites = sprintf "/guilds/%d/invites"
+let guild_integrations = sprintf "/guilds/%d/integrations"
+let guild_integration = sprintf "/guilds/%d/integrations/%d"
+let guild_integration_sync = sprintf "/guilds/%d/integrations/%d/sync"
+let guild_embed = sprintf "/guilds/%d/embed"
+let guild_emojis = sprintf "/guilds/%d/emojis"
+let guild_emoji = sprintf "/guilds/%d/emojis/%d"
+let webhooks_guild = sprintf "/guilds/%d/webhooks"
+let webhooks_channel = sprintf "/channels/%d/webhooks"
+let webhook = sprintf "/webhooks/%d"
+let webhook_token = sprintf "/webhooks/%d/%s"
+let webhook_git = sprintf "/webhooks/%d/%s/github"
+let webhook_slack = sprintf "/webhooks/%d/%s/slack"
+let user = sprintf "/users/%d"
let me = "/users/@me"
let me_guilds = "/users/@me/guilds"
-let me_guild guild_id = "/users/@me/guilds/"^guild_id
+let me_guild = sprintf "/users/@me/guilds/%d"
let me_channels = "/users/@me/channels"
let me_connections = "/users/@me/connections"
-
-let invite code = "/invites/"^code
+let invite = sprintf "/invites/%s"
let regions = "/voice/regions"
-
let application_information = "/oauth2/applications/@me"
-
-let group_recipient group_id user_id = "/channels/"^group_id^"/recipients/"^user_id
-let guild_me_nick guild_id = "/guilds/"^guild_id^"/members/@me/nick"
-let guild_vanity_url guild_id = "/guilds/"^guild_id^"/vanity-url"
-let guild_audit_logs guild_id = "/guilds/"^guild_id^"/audit-logs"
-
-(* let cdn_avatar id avatar image_format = "/avatars/"^id^"/"^avatar^"."^image_format *)
-let cdn_embed_avatar image_name = "/embed/avatars/"^image_name^".png"
-let cdn_emoji id image_format = "/emojis/"^id^"."^image_format
-let cdn_icon id icon image_format = "/icons/"^id^"/"^icon^"."^image_format
-let cdn_avatar id splash image_format = "/splashes/"^id^"/"^splash^"."^image_format \ No newline at end of file
+let group_recipient = sprintf "/channels/%d/recipients/%d"
+let guild_me_nick = sprintf "/guilds/%d/members/@me/nick"
+let guild_vanity_url = sprintf "/guilds/%d/vanity-url"
+let guild_audit_logs = sprintf "/guilds/%d/audit-logs"
+let cdn_embed_avatar = sprintf "/embed/avatars/%s.png"
+let cdn_emoji = sprintf "/emojis/%s.%s"
+let cdn_icon = sprintf "/icons/%d/%s.%s"
+let cdn_avatar = sprintf "/splashes/%d/%s.%s" \ No newline at end of file
diff --git a/lib/models/message.ml b/lib/models/message.ml
index 7849afe..29148ee 100644
--- a/lib/models/message.ml
+++ b/lib/models/message.ml
@@ -1,7 +1,43 @@
module Make(Http : S.Http) = struct
- let reply (message:Message_t.t) str =
- let msg = `Assoc [
- ("content", `String str)
- ] in
- Http.create_message (string_of_int (message.channel_id)) (msg)
+ open Message_t
+
+ let add_reaction msg (emoji:Emoji_t.t) =
+ let e = match emoji.id with
+ | Some i -> Printf.sprintf "%s:%d" emoji.name i
+ | None -> emoji.name
+ in
+ Http.create_reaction msg.channel_id msg.id e
+
+ let remove_reaction msg (emoji:Emoji_t.t) (user:User_t.t) =
+ let e = match emoji.id with
+ | Some i -> Printf.sprintf "%s:%d" emoji.name i
+ | None -> emoji.name
+ in
+ Http.delete_reaction msg.channel_id msg.id e user.id
+
+ let clear_reactions msg =
+ Http.delete_reactions msg.channel_id msg.id
+
+ let delete msg =
+ Http.delete_message msg.channel_id msg.id
+
+ let pin msg =
+ Http.pin_message msg.channel_id msg.id
+
+ let unpin msg =
+ Http.unpin_message msg.channel_id msg.id
+
+ let reply msg cont =
+ let rep = `Assoc [("content", `String cont)] in
+ Http.create_message msg.channel_id rep
+
+ let set_content msg cont =
+ Message_j.string_of_t { msg with content = cont; }
+ |> Yojson.Safe.from_string
+ |> Http.edit_message msg.channel_id msg.id
+
+ let set_embed msg embed =
+ Message_j.string_of_t { msg with embeds = [embed]; }
+ |> Yojson.Safe.from_string
+ |> Http.edit_message msg.channel_id msg.id
end \ No newline at end of file
diff --git a/lib/models/message.mli b/lib/models/message.mli
new file mode 100644
index 0000000..6f6242f
--- /dev/null
+++ b/lib/models/message.mli
@@ -0,0 +1 @@
+module Make(Http : S.Http) : S.Message \ No newline at end of file
diff --git a/lib/s.ml b/lib/s.ml
index 40af880..f4f0e77 100644
--- a/lib/s.ml
+++ b/lib/s.ml
@@ -21,7 +21,15 @@ module type Guild = sig end
module type Member = sig end
module type Message = sig
- val reply : Message_t.t -> string -> Yojson.Safe.json Deferred.t
+ val add_reaction : Message_t.t -> Emoji_t.t -> Yojson.Safe.json Deferred.t
+ val remove_reaction : Message_t.t -> Emoji_t.t -> User_t.t -> Yojson.Safe.json Deferred.t
+ val clear_reactions : Message_t.t -> Yojson.Safe.json Deferred.t
+ val delete : Message_t.t -> Yojson.Safe.json Deferred.t
+ val pin : Message_t.t -> Yojson.Safe.json Deferred.t
+ val unpin : Message_t.t -> Yojson.Safe.json Deferred.t
+ val reply : Message_t.t -> string -> Yojson.Safe.json Deferred.t
+ val set_content : Message_t.t -> string -> Yojson.Safe.json Deferred.t
+ val set_embed : Message_t.t -> Embed_t.t -> Yojson.Safe.json Deferred.t
end
module type Presence = sig end
@@ -90,163 +98,139 @@ module type Http = sig
end
(* Auto-generated signatures *)
- val get_gateway : unit -> Yojson.Safe.json Async.Deferred.t
- val get_gateway_bot : unit -> Yojson.Safe.json Async.Deferred.t
- val get_channel : string -> Yojson.Safe.json Async.Deferred.t
+ val get_gateway : unit -> Yojson.Safe.json Conduit_async.io
+ val get_gateway_bot : unit -> Yojson.Safe.json Conduit_async.io
+ val get_channel : int -> Yojson.Safe.json Conduit_async.io
val modify_channel :
- string -> Yojson.Safe.json -> Yojson.Safe.json Async.Deferred.t
- val delete_channel : string -> Yojson.Safe.json Async.Deferred.t
- val get_messages : string -> Yojson.Safe.json Async.Deferred.t
- val get_message : string -> string -> Yojson.Safe.json Async.Deferred.t
+ int -> Yojson.Safe.json -> Yojson.Safe.json Conduit_async.io
+ val delete_channel : int -> Yojson.Safe.json Conduit_async.io
+ val get_messages : int -> Yojson.Safe.json Conduit_async.io
+ val get_message : int -> int -> Yojson.Safe.json Conduit_async.io
val create_message :
- string -> Yojson.Safe.json -> Yojson.Safe.json Async.Deferred.t
+ int -> Yojson.Safe.json -> Yojson.Safe.json Conduit_async.io
val create_reaction :
- string -> string -> string -> Yojson.Safe.json Async.Deferred.t
+ int -> int -> string -> Yojson.Safe.json Conduit_async.io
val delete_own_reaction :
- string -> string -> string -> Yojson.Safe.json Async.Deferred.t
+ int -> int -> string -> Yojson.Safe.json Conduit_async.io
val delete_reaction :
- string ->
- string -> string -> string -> Yojson.Safe.json Async.Deferred.t
+ int -> int -> string -> int -> Yojson.Safe.json Conduit_async.io
val get_reactions :
- string -> string -> string -> Yojson.Safe.json Async.Deferred.t
- val delete_reactions :
- string -> string -> Yojson.Safe.json Async.Deferred.t
+ int -> int -> string -> Yojson.Safe.json Conduit_async.io
+ val delete_reactions : int -> int -> Yojson.Safe.json Conduit_async.io
val edit_message :
- string ->
- string -> Yojson.Safe.json -> Yojson.Safe.json Async.Deferred.t
- val delete_message :
- string -> string -> Yojson.Safe.json Async.Deferred.t
+ int -> int -> Yojson.Safe.json -> Yojson.Safe.json Conduit_async.io
+ val delete_message : int -> int -> Yojson.Safe.json Conduit_async.io
val bulk_delete :
- string -> Yojson.Safe.json -> Yojson.Safe.json Async.Deferred.t
+ int -> Yojson.Safe.json -> Yojson.Safe.json Conduit_async.io
val edit_channel_permissions :
- string ->
- string -> Yojson.Safe.json -> Yojson.Safe.json Async.Deferred.t
- val get_channel_invites : string -> Yojson.Safe.json Async.Deferred.t
+ int -> int -> Yojson.Safe.json -> Yojson.Safe.json Conduit_async.io
+ val get_channel_invites : int -> Yojson.Safe.json Conduit_async.io
val create_channel_invite :
- string -> Yojson.Safe.json -> Yojson.Safe.json Async.Deferred.t
+ int -> Yojson.Safe.json -> Yojson.Safe.json Conduit_async.io
val delete_channel_permission :
- string -> string -> Yojson.Safe.json Async.Deferred.t
- val broadcast_typing : string -> Yojson.Safe.json Async.Deferred.t
- val get_pinned_messages : string -> Yojson.Safe.json Async.Deferred.t
- val pin_message : string -> string -> Yojson.Safe.json Async.Deferred.t
- val unpin_message :
- string -> string -> Yojson.Safe.json Async.Deferred.t
- val group_recipient_add :
- string -> string -> Yojson.Safe.json Async.Deferred.t
+ int -> int -> Yojson.Safe.json Conduit_async.io
+ val broadcast_typing : int -> Yojson.Safe.json Conduit_async.io
+ val get_pinned_messages : int -> Yojson.Safe.json Conduit_async.io
+ val pin_message : int -> int -> Yojson.Safe.json Conduit_async.io
+ val unpin_message : int -> int -> Yojson.Safe.json Conduit_async.io
+ val group_recipient_add : int -> int -> Yojson.Safe.json Conduit_async.io
val group_recipient_remove :
- string -> string -> Yojson.Safe.json Async.Deferred.t
- val get_emojis : string -> Yojson.Safe.json Async.Deferred.t
- val get_emoji : string -> string -> Yojson.Safe.json Async.Deferred.t
+ int -> int -> Yojson.Safe.json Conduit_async.io
+ val get_emojis : int -> Yojson.Safe.json Conduit_async.io
+ val get_emoji : int -> int -> Yojson.Safe.json Conduit_async.io
val create_emoji :
- string -> Yojson.Safe.json -> Yojson.Safe.json Async.Deferred.t
+ int -> Yojson.Safe.json -> Yojson.Safe.json Conduit_async.io
val edit_emoji :
- string ->
- string -> Yojson.Safe.json -> Yojson.Safe.json Async.Deferred.t
- val delete_emoji : string -> string -> Yojson.Safe.json Async.Deferred.t
- val create_guild :
- Yojson.Safe.json -> Yojson.Safe.json Async.Deferred.t
- val get_guild : string -> Yojson.Safe.json Async.Deferred.t
+ int -> int -> Yojson.Safe.json -> Yojson.Safe.json Conduit_async.io
+ val delete_emoji : int -> int -> Yojson.Safe.json Conduit_async.io
+ val create_guild : Yojson.Safe.json -> Yojson.Safe.json Conduit_async.io
+ val get_guild : int -> Yojson.Safe.json Conduit_async.io
val edit_guild :
- string -> Yojson.Safe.json -> Yojson.Safe.json Async.Deferred.t
- val delete_guild : string -> Yojson.Safe.json Async.Deferred.t
- val get_guild_channels : string -> Yojson.Safe.json Async.Deferred.t
+ int -> Yojson.Safe.json -> Yojson.Safe.json Conduit_async.io
+ val delete_guild : int -> Yojson.Safe.json Conduit_async.io
+ val get_guild_channels : int -> Yojson.Safe.json Conduit_async.io
val create_guild_channel :
- string -> Yojson.Safe.json -> Yojson.Safe.json Async.Deferred.t
+ int -> Yojson.Safe.json -> Yojson.Safe.json Conduit_async.io
val modify_guild_channel_positions :
- string -> Yojson.Safe.json -> Yojson.Safe.json Async.Deferred.t
- val get_member : string -> string -> Yojson.Safe.json Async.Deferred.t
- val get_members : string -> Yojson.Safe.json Async.Deferred.t
+ int -> Yojson.Safe.json -> Yojson.Safe.json Conduit_async.io
+ val get_member : int -> int -> Yojson.Safe.json Conduit_async.io
+ val get_members : int -> Yojson.Safe.json Conduit_async.io
val add_member :
- string ->
- string -> Yojson.Safe.json -> Yojson.Safe.json Async.Deferred.t
+ int -> int -> Yojson.Safe.json -> Yojson.Safe.json Conduit_async.io
val edit_member :
- string ->
- string -> Yojson.Safe.json -> Yojson.Safe.json Async.Deferred.t
- val remove_member :
- string -> string -> Yojson.Safe.json Async.Deferred.t
+ int -> int -> Yojson.Safe.json -> Yojson.Safe.json Conduit_async.io
+ val remove_member : int -> int -> Yojson.Safe.json Conduit_async.io
val change_nickname :
- string -> Yojson.Safe.json -> Yojson.Safe.json Async.Deferred.t
+ int -> Yojson.Safe.json -> Yojson.Safe.json Conduit_async.io
val add_member_role :
- string -> string -> string -> Yojson.Safe.json Async.Deferred.t
+ int -> int -> int -> Yojson.Safe.json Conduit_async.io
val remove_member_role :
- string -> string -> string -> Yojson.Safe.json Async.Deferred.t
- val get_bans : string -> Yojson.Safe.json Async.Deferred.t
- val get_ban : string -> string -> Yojson.Safe.json Async.Deferred.t
+ int -> int -> int -> Yojson.Safe.json Conduit_async.io
+ val get_bans : int -> Yojson.Safe.json Conduit_async.io
+ val get_ban : int -> int -> Yojson.Safe.json Conduit_async.io
val guild_ban_add :
- string ->
- string -> Yojson.Safe.json -> Yojson.Safe.json Async.Deferred.t
- val guild_ban_remove :
- string -> string -> Yojson.Safe.json Async.Deferred.t
- val get_roles : string -> Yojson.Safe.json Async.Deferred.t
+ int -> int -> Yojson.Safe.json -> Yojson.Safe.json Conduit_async.io
+ val guild_ban_remove : int -> int -> Yojson.Safe.json Conduit_async.io
+ val get_roles : int -> Yojson.Safe.json Conduit_async.io
val guild_role_add :
- string -> Yojson.Safe.json -> Yojson.Safe.json Async.Deferred.t
+ int -> Yojson.Safe.json -> Yojson.Safe.json Conduit_async.io
val guild_roles_edit :
- string -> Yojson.Safe.json -> Yojson.Safe.json Async.Deferred.t
+ int -> Yojson.Safe.json -> Yojson.Safe.json Conduit_async.io
val guild_role_edit :
- string ->
- string -> Yojson.Safe.json -> Yojson.Safe.json Async.Deferred.t
- val guild_role_remove :
- string -> string -> Yojson.Safe.json Async.Deferred.t
- val guild_prune_count : string -> Yojson.Safe.json Async.Deferred.t
+ int -> int -> Yojson.Safe.json -> Yojson.Safe.json Conduit_async.io
+ val guild_role_remove : int -> int -> Yojson.Safe.json Conduit_async.io
+ val guild_prune_count : int -> Yojson.Safe.json Conduit_async.io
val guild_prune_start :
- string -> Yojson.Safe.json -> Yojson.Safe.json Async.Deferred.t
- val get_guild_voice_regions :
- string -> Yojson.Safe.json Async.Deferred.t
- val get_guild_invites : string -> Yojson.Safe.json Async.Deferred.t
- val get_integrations : string -> Yojson.Safe.json Async.Deferred.t
+ int -> Yojson.Safe.json -> Yojson.Safe.json Conduit_async.io
+ val get_guild_voice_regions : int -> Yojson.Safe.json Conduit_async.io
+ val get_guild_invites : int -> Yojson.Safe.json Conduit_async.io
+ val get_integrations : int -> Yojson.Safe.json Conduit_async.io
val add_integration :
- string -> Yojson.Safe.json -> Yojson.Safe.json Async.Deferred.t
+ int -> Yojson.Safe.json -> Yojson.Safe.json Conduit_async.io
val edit_integration :
- string ->
- string -> Yojson.Safe.json -> Yojson.Safe.json Async.Deferred.t
- val delete_integration :
- string -> string -> Yojson.Safe.json Async.Deferred.t
- val sync_integration :
- string -> string -> Yojson.Safe.json Async.Deferred.t
- val get_guild_embed : string -> Yojson.Safe.json Async.Deferred.t
+ int -> int -> Yojson.Safe.json -> Yojson.Safe.json Conduit_async.io
+ val delete_integration : int -> int -> Yojson.Safe.json Conduit_async.io
+ val sync_integration : int -> int -> Yojson.Safe.json Conduit_async.io
+ val get_guild_embed : int -> Yojson.Safe.json Conduit_async.io
val edit_guild_embed :
- string -> Yojson.Safe.json -> Yojson.Safe.json Async.Deferred.t
- val get_vanity_url : string -> Yojson.Safe.json Async.Deferred.t
- val get_invite : string -> Yojson.Safe.json Async.Deferred.t
- val delete_invite : string -> Yojson.Safe.json Async.Deferred.t
- val get_current_user : unit -> Yojson.Safe.json Async.Deferred.t
+ int -> Yojson.Safe.json -> Yojson.Safe.json Conduit_async.io
+ val get_vanity_url : int -> Yojson.Safe.json Conduit_async.io
+ val get_invite : string -> Yojson.Safe.json Conduit_async.io
+ val delete_invite : string -> Yojson.Safe.json Conduit_async.io
+ val get_current_user : unit -> Yojson.Safe.json Conduit_async.io
val edit_current_user :
- Yojson.Safe.json -> Yojson.Safe.json Async.Deferred.t
- val get_guilds : unit -> Yojson.Safe.json Async.Deferred.t
- val leave_guild : string -> Yojson.Safe.json Async.Deferred.t
- val get_private_channels : unit -> Yojson.Safe.json Async.Deferred.t
- val create_dm : Yojson.Safe.json -> Yojson.Safe.json Async.Deferred.t
+ Yojson.Safe.json -> Yojson.Safe.json Conduit_async.io
+ val get_guilds : unit -> Yojson.Safe.json Conduit_async.io
+ val leave_guild : int -> Yojson.Safe.json Conduit_async.io
+ val get_private_channels : unit -> Yojson.Safe.json Conduit_async.io
+ val create_dm : Yojson.Safe.json -> Yojson.Safe.json Conduit_async.io
val create_group_dm :
- Yojson.Safe.json -> Yojson.Safe.json Async.Deferred.t
- val get_connections : unit -> Yojson.Safe.json Async.Deferred.t
- val get_user : string -> Yojson.Safe.json Async.Deferred.t
- val get_voice_regions : unit -> Yojson.Safe.json Async.Deferred.t
+ Yojson.Safe.json -> Yojson.Safe.json Conduit_async.io
+ val get_connections : unit -> Yojson.Safe.json Conduit_async.io
+ val get_user : int -> Yojson.Safe.json Conduit_async.io
+ val get_voice_regions : unit -> Yojson.Safe.json Conduit_async.io
val create_webhook :
- string -> Yojson.Safe.json -> Yojson.Safe.json Async.Deferred.t
- val get_channel_webhooks : string -> Yojson.Safe.json Async.Deferred.t
- val get_guild_webhooks : string -> Yojson.Safe.json Async.Deferred.t
- val get_webhook : string -> Yojson.Safe.json Async.Deferred.t
+ int -> Yojson.Safe.json -> Yojson.Safe.json Conduit_async.io
+ val get_channel_webhooks : int -> Yojson.Safe.json Conduit_async.io
+ val get_guild_webhooks : int -> Yojson.Safe.json Conduit_async.io
+ val get_webhook : int -> Yojson.Safe.json Conduit_async.io
val get_webhook_with_token :
- string -> string -> Yojson.Safe.json Async.Deferred.t
+ int -> string -> Yojson.Safe.json Conduit_async.io
val edit_webhook :
- string -> Yojson.Safe.json -> Yojson.Safe.json Async.Deferred.t
+ int -> Yojson.Safe.json -> Yojson.Safe.json Conduit_async.io
val edit_webhook_with_token :
- string ->
- string -> Yojson.Safe.json -> Yojson.Safe.json Async.Deferred.t
- val delete_webhook : string -> Yojson.Safe.json Async.Deferred.t
+ int -> string -> Yojson.Safe.json -> Yojson.Safe.json Conduit_async.io
+ val delete_webhook : int -> Yojson.Safe.json Conduit_async.io
val delete_webhook_with_token :
- string -> string -> Yojson.Safe.json Async.Deferred.t
+ int -> string -> Yojson.Safe.json Conduit_async.io
val execute_webhook :
- string ->
- string -> Yojson.Safe.json -> Yojson.Safe.json Async.Deferred.t
+ int -> string -> Yojson.Safe.json -> Yojson.Safe.json Conduit_async.io
val execute_slack_webhook :
- string ->
- string -> Yojson.Safe.json -> Yojson.Safe.json Async.Deferred.t
+ int -> string -> Yojson.Safe.json -> Yojson.Safe.json Conduit_async.io
val execute_git_webhook :
- string ->
- string -> Yojson.Safe.json -> Yojson.Safe.json Async.Deferred.t
+ int -> string -> Yojson.Safe.json -> Yojson.Safe.json Conduit_async.io
val get_audit_logs :
- string -> Yojson.Safe.json -> Yojson.Safe.json Async.Deferred.t
+ int -> Yojson.Safe.json -> Yojson.Safe.json Conduit_async.io
end
module type Sharder = sig