aboutsummaryrefslogtreecommitdiff
path: root/lib/models/guild/role_t.mli
blob: 630ba5312b9af6677604a1aa2fb258b9f15abe1e (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
(** A role as Discord sends it. Only difference between this and {!t} is the lack of the guild_id field. *)
type role = {
    id: Role_id.t;
    name: string;
    colour: int;
    hoist: bool;
    position: int;
    permissions: Permissions.t;
    managed: bool;
    mentionable: bool;
} [@@deriving sexp, yojson]

(** A role object. *)
type t = {
    id: Role_id.t; (** The role's snowflake ID. *)
    name: string; (** The role's name. *)
    colour: int; (** The integer representation of the role colour. *)
    hoist: bool; (** Whether the role is hoisted. This property controls whether the role is separated on the sidebar. *)
    position: int; (** The position of the role. [@everyone] begins the list at 0. *)
    permissions: Permissions.t; (** The integer representation of the permissions the role has. *)
    managed: bool; (** Whether the guild is managed by an integration. *)
    mentionable: bool; (** Whether the role can be mentioned. *)
    guild_id: Guild_id_t.t; (** The guild ID this role belongs to. *)
} [@@deriving sexp, yojson]

(** Convenience method to produce {!t} from {!role} and a snowflake. *)
val wrap : guild_id:Snowflake.t -> role -> t