aboutsummaryrefslogtreecommitdiff
path: root/lib/models/user
diff options
context:
space:
mode:
Diffstat (limited to 'lib/models/user')
-rw-r--r--lib/models/user/activity.ml2
-rw-r--r--lib/models/user/activity.mli2
-rw-r--r--lib/models/user/presence.ml2
-rw-r--r--lib/models/user/presence.mli2
-rw-r--r--lib/models/user/user.ml8
-rw-r--r--lib/models/user/user_t.ml4
-rw-r--r--lib/models/user/user_t.mli4
7 files changed, 11 insertions, 13 deletions
diff --git a/lib/models/user/activity.ml b/lib/models/user/activity.ml
index 926c899..293de3b 100644
--- a/lib/models/user/activity.ml
+++ b/lib/models/user/activity.ml
@@ -4,4 +4,4 @@ type t = {
name: string;
kind: int [@key "type"];
url: string option [@default None];
-} [@@deriving sexp, yojson { strict = false; exn = true }] \ No newline at end of file
+} [@@deriving sexp, yojson] \ No newline at end of file
diff --git a/lib/models/user/activity.mli b/lib/models/user/activity.mli
index 2757f54..1ddd4e7 100644
--- a/lib/models/user/activity.mli
+++ b/lib/models/user/activity.mli
@@ -3,4 +3,4 @@ type t = {
name: string; (** The name of the activity. *)
kind: int; (** 0 = Playing, 1 = Streaming, 2 = Listening, 3 = Watching *)
url: string option; (** Stream URL. Only validated for kind = 1. *)
-} [@@deriving sexp, yojson { exn = true }] \ No newline at end of file
+} [@@deriving sexp, yojson] \ No newline at end of file
diff --git a/lib/models/user/presence.ml b/lib/models/user/presence.ml
index d8683b7..8d5d205 100644
--- a/lib/models/user/presence.ml
+++ b/lib/models/user/presence.ml
@@ -5,4 +5,4 @@ type t = {
game: Activity.t option [@default None];
status: string;
activities: Activity.t list;
-} [@@deriving sexp, yojson { strict = false; exn = true }] \ No newline at end of file
+} [@@deriving sexp, yojson] \ No newline at end of file
diff --git a/lib/models/user/presence.mli b/lib/models/user/presence.mli
index ae01373..58a7c25 100644
--- a/lib/models/user/presence.mli
+++ b/lib/models/user/presence.mli
@@ -4,4 +4,4 @@ type t = {
game: Activity.t option; (** The current activity of the user, if any. *)
status: string; (** One of [online], [idle], [offline], or [dnd]. *)
activities: Activity.t list; (** A list of all of the user's current activities. *)
-} [@@deriving sexp, yojson { exn = true }] \ No newline at end of file
+} [@@deriving sexp, yojson] \ No newline at end of file
diff --git a/lib/models/user/user.ml b/lib/models/user/user.ml
index b8c3b25..8b14b76 100644
--- a/lib/models/user/user.ml
+++ b/lib/models/user/user.ml
@@ -5,19 +5,17 @@ let tag user =
Printf.sprintf "%s#%s" user.username user.discriminator
let mention user =
- let `User_id id = user.id in
- Printf.sprintf "<@%d>" id
+ Printf.sprintf "<@%Ld>" (User_id.get_id user.id)
let default_avatar user =
- let avatar = Int.of_string user.discriminator % 5 in
+ let avatar = Int64.(of_string user.discriminator % 5L) in
Endpoints.cdn_default_avatar avatar
let face user =
- let `User_id id = user.id in
match user.avatar with
| Some avatar ->
let ext = if String.is_substring ~substring:"a_" avatar
then "gif"
else "png" in
- Endpoints.cdn_avatar id avatar ext
+ Endpoints.cdn_avatar (User_id.get_id user.id) avatar ext
| None -> default_avatar user \ No newline at end of file
diff --git a/lib/models/user/user_t.ml b/lib/models/user/user_t.ml
index b68808d..8c367fc 100644
--- a/lib/models/user/user_t.ml
+++ b/lib/models/user/user_t.ml
@@ -6,7 +6,7 @@ type partial_user = {
discriminator: string option [@default None];
avatar: string option [@default None];
bot: bool [@default false];
-} [@@deriving sexp, yojson { strict = false; exn = true }]
+} [@@deriving sexp, yojson]
type t = {
id: User_id_t.t;
@@ -14,4 +14,4 @@ type t = {
discriminator: string;
avatar: string option [@default None];
bot: bool [@default false];
-} [@@deriving sexp, yojson { strict = false; exn = true }] \ No newline at end of file
+} [@@deriving sexp, yojson] \ No newline at end of file
diff --git a/lib/models/user/user_t.mli b/lib/models/user/user_t.mli
index 78f7a28..e971531 100644
--- a/lib/models/user/user_t.mli
+++ b/lib/models/user/user_t.mli
@@ -5,7 +5,7 @@ type partial_user = {
discriminator: string option;
avatar: string option;
bot: bool;
-} [@@deriving sexp, yojson { exn = true }]
+} [@@deriving sexp, yojson]
(** A user object. *)
type t = {
@@ -14,4 +14,4 @@ type t = {
discriminator: string; (** The 4 digits, as a string, that come after the '#' in a Discord username. *)
avatar: string option; (** The hash of the user avatar, if they have one set. See {!User.face} to get the avatar URL. *)
bot: bool; (** Whether the user is a bot. *)
-} [@@deriving sexp, yojson { exn = true }] \ No newline at end of file
+} [@@deriving sexp, yojson] \ No newline at end of file