diff options
| author | Adelyn Breedlove <[email protected]> | 2019-01-13 23:52:45 +0000 |
|---|---|---|
| committer | Adelyn Breedlove <[email protected]> | 2019-01-13 23:52:45 +0000 |
| commit | d95f0342f9cf2280b5d9794ab638c16a59c02a69 (patch) | |
| tree | 191164d198c07cf388d9aae8a54013e5613c272c /lib/models/role_t.ml | |
| parent | Merge branch 'dev' into 'master' (diff) | |
| parent | Add deriving sexp to models (diff) | |
| download | disml-d95f0342f9cf2280b5d9794ab638c16a59c02a69.tar.xz disml-d95f0342f9cf2280b5d9794ab638c16a59c02a69.zip | |
Merge branch 'switch-to-deriving_yojson' into 'master'
Switch to deriving yojson
See merge request Mishio595/disml!12
Diffstat (limited to 'lib/models/role_t.ml')
| -rw-r--r-- | lib/models/role_t.ml | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/models/role_t.ml b/lib/models/role_t.ml new file mode 100644 index 0000000..e41f31d --- /dev/null +++ b/lib/models/role_t.ml @@ -0,0 +1,32 @@ +open Core + +type role = { + id: Snowflake.t; + name: string; + colour: int [@key "color"]; + hoist: bool; + position: int; + permissions: int; + managed: bool; + mentionable: bool; +} [@@deriving sexp, yojson { strict = false}] + +type role_update = { + role: role; + guild_id: Snowflake.t; +} [@@deriving sexp, yojson { strict = false}] + +type t = { + id: Snowflake.t; + name: string; + colour: int [@key "color"]; + hoist: bool; + position: int; + permissions: int; + managed: bool; + mentionable: bool; + guild_id: Snowflake.t; +} [@@deriving sexp, yojson { strict = false}] + +let wrap ~guild_id ({id;name;colour;hoist;position;permissions;managed;mentionable}:role) = + {id;name;colour;hoist;position;permissions;managed;mentionable;guild_id}
\ No newline at end of file |