aboutsummaryrefslogtreecommitdiff
path: root/lib/models/channel/channel.ml
diff options
context:
space:
mode:
authorMatias Goldfeld <[email protected]>2021-01-29 13:42:34 -0500
committerMatias Goldfeld <[email protected]>2021-01-29 13:42:34 -0500
commit2f37138dedb34651ddb2efd687a8d860b0138778 (patch)
treeb0d89ca5795724b3bb804f2d65ee609217567ecd /lib/models/channel/channel.ml
parentRevert "More 32 bit fixes" (diff)
downloaddisml-2f37138dedb34651ddb2efd687a8d860b0138778.tar.xz
disml-2f37138dedb34651ddb2efd687a8d860b0138778.zip
Reverted attempts to add 32-bit compatibility
Diffstat (limited to 'lib/models/channel/channel.ml')
-rw-r--r--lib/models/channel/channel.ml17
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/models/channel/channel.ml b/lib/models/channel/channel.ml
index 47cf500..52eda02 100644
--- a/lib/models/channel/channel.ml
+++ b/lib/models/channel/channel.ml
@@ -6,7 +6,7 @@ exception No_message_found
let send_message ?embed ?content ?file ?(tts=false) ch =
let embed = match embed with
- | Some e -> Embed.to_yojson e
+ | Some e -> Embed.yojson_of_t e
| None -> `Null in
let content = match content with
| Some c -> `String c
@@ -33,16 +33,13 @@ let delete ch =
let get_message ~id ch =
Http.get_message (get_id ch) id
-let get_messages ?(mode=`Around) ?id ?(limit=50) ch =
+let get_messages ?(mode=`Around) ~id ?(limit=50) ch =
let kind = match mode with
- | `Around -> "around", limit
- | `Before -> "before", limit
- | `After -> "after", limit
+ | `Around -> "around", id
+ | `Before -> "before", id
+ | `After -> "after", id
in
- let id = match id with
- | Some id -> id
- | None -> raise No_message_found in
- Http.get_messages (get_id ch) id kind
+ Http.get_messages (get_id ch) limit kind
let broadcast_typing ch =
Http.broadcast_typing (get_id ch)
@@ -51,5 +48,5 @@ let get_pins ch =
Http.get_pinned_messages (get_id ch)
let bulk_delete msgs ch =
- let msgs = `List (List.map ~f:(fun id -> `Int id) msgs) in
+ let msgs = `List (List.map ~f:(fun id -> `Intlit (Int64.to_string id)) msgs) in
Http.bulk_delete (get_id ch) msgs \ No newline at end of file