blob: 0724e54add6f0366cdedeb5a41f21276cd5cd6c3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
open Core
type partial_member = {
nick: string option [@default None];
roles: Role_id.t list;
joined_at: string;
deaf: bool;
mute: bool;
} [@@deriving sexp, yojson]
type member = {
nick: string option [@default None];
roles: Role_id.t list;
joined_at: string;
deaf: bool;
mute: bool;
user: User_t.t;
} [@@deriving sexp, yojson]
type member_wrapper = {
guild_id: Guild_id_t.t;
user: User_t.t;
} [@@deriving sexp, yojson]
type member_update = {
guild_id: Guild_id_t.t;
roles: Role_id.t list [@default []];
user: User_t.t;
nick: string option [@default None];
} [@@deriving sexp, yojson]
type t = {
nick: string option [@default None];
roles: Role_id.t list;
joined_at: string;
deaf: bool;
mute: bool;
user: User_t.t;
guild_id: Guild_id_t.t;
} [@@deriving sexp, yojson]
let wrap ~guild_id ({nick;roles;joined_at;deaf;mute;user}:member) =
{nick;roles;joined_at;deaf;mute;user;guild_id = `Guild_id guild_id}
|