aboutsummaryrefslogtreecommitdiff
path: root/lib/models/guild/role_t.ml
blob: 2927c20264a4e718b3e99f35647651a5a97c2699 (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
open Core

type role = {
    id: Role_id.t;
    name: string;
    colour: int [@key "color"];
    hoist: bool;
    position: int;
    permissions: Permissions.t;
    managed: bool;
    mentionable: bool;
} [@@deriving sexp, yojson { strict = false; exn = true }]

type t = {
    id: Role_id.t;
    name: string;
    colour: int [@key "color"];
    hoist: bool;
    position: int;
    permissions: Permissions.t;
    managed: bool;
    mentionable: bool;
    guild_id: Guild_id_t.t;
} [@@deriving sexp, yojson { strict = false; exn = true }]

let wrap ~guild_id ({id;name;colour;hoist;position;permissions;managed;mentionable}:role) =
    {id;name;colour;hoist;position;permissions;managed;mentionable;guild_id = `Guild_id guild_id}