blob: cb9193606f5c3f949cfd7adf230c715e824e2467 (
plain) (
blame)
1
2
|
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Role (disml.Disml__.Role)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../../index.html">disml</a> » <a href="../index.html">Disml__</a> » Role</nav><h1>Module <code>Disml__.Role</code></h1></header><div><div class="spec include"><div class="doc"><details open="open"><summary><span class="def"><code><span class="keyword">include </span><span class="keyword">module type of </span><a href="../index.html#module-Role_t">Disml__.Role_t</a></code></span></summary><aside></aside><dl><dt class="spec type" id="type-role"><a href="#type-role" class="anchor"></a><code><span class="keyword">type </span>role</code><code><span class="keyword"> = </span></code><code>{</code><table class="record"><tr id="type-role.id" class="anchored"><td class="def field"><a href="#type-role.id" class="anchor"></a><code>id : <a href="../Role_id/index.html#type-t">Disml__.Role_id.t</a>;</code></td></tr><tr id="type-role.name" class="anchored"><td class="def field"><a href="#type-role.name" class="anchor"></a><code>name : string;</code></td></tr><tr id="type-role.colour" class="anchored"><td class="def field"><a href="#type-role.colour" class="anchor"></a><code>colour : int;</code></td></tr><tr id="type-role.hoist" class="anchored"><td class="def field"><a href="#type-role.hoist" class="anchor"></a><code>hoist : bool;</code></td></tr><tr id="type-role.position" class="anchored"><td class="def field"><a href="#type-role.position" class="anchor"></a><code>position : int;</code></td></tr><tr id="type-role.permissions" class="anchored"><td class="def field"><a href="#type-role.permissions" class="anchor"></a><code>permissions : int;</code></td></tr><tr id="type-role.managed" class="anchored"><td class="def field"><a href="#type-role.managed" class="anchor"></a><code>managed : bool;</code></td></tr><tr id="type-role.mentionable" class="anchored"><td class="def field"><a href="#type-role.mentionable" class="anchor"></a><code>mentionable : bool;</code></td></tr></table><code>}</code></dt><dd><p>A role as Discord sends it. Only difference between this and <a href="index.html#type-t"><code>t</code></a> is the lack of the guild_id field.</p></dd></dl><div><div class="spec include"><div class="doc"><dl><dt class="spec value" id="val-role_of_sexp"><a href="#val-role_of_sexp" class="anchor"></a><code><span class="keyword">val </span>role_of_sexp : Ppx_sexp_conv_lib.Sexp.t <span>-></span> <a href="index.html#type-role">role</a></code></dt><dt class="spec value" id="val-sexp_of_role"><a href="#val-sexp_of_role" class="anchor"></a><code><span class="keyword">val </span>sexp_of_role : <a href="index.html#type-role">role</a> <span>-></span> Ppx_sexp_conv_lib.Sexp.t</code></dt></dl></div></div></div><dl><dt class="spec value" id="val-role_to_yojson"><a href="#val-role_to_yojson" class="anchor"></a><code><span class="keyword">val </span>role_to_yojson : <a href="index.html#type-role">role</a> <span>-></span> Yojson.Safe.json</code></dt><dt class="spec value" id="val-role_of_yojson"><a href="#val-role_of_yojson" class="anchor"></a><code><span class="keyword">val </span>role_of_yojson : Yojson.Safe.json <span>-></span> <a href="index.html#type-role">role</a> Ppx_deriving_yojson_runtime.error_or</code></dt><dt class="spec value" id="val-role_of_yojson_exn"><a href="#val-role_of_yojson_exn" class="anchor"></a><code><span class="keyword">val </span>role_of_yojson_exn : Yojson.Safe.json <span>-></span> <a href="index.html#type-role">role</a></code></dt></dl><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type </span>t</code><code><span class="keyword"> = </span></code><code>{</code><table class="record"><tr id="type-t.id" class="anchored"><td class="def field"><a href="#type-t.id" class="anchor"></a><code>id : <a href="../Role_id/index.html#type-t">Disml__.Role_id.t</a>;</code></td><td class="doc"><p>The role's snowflake ID.</p></td></tr><tr id="type-t.name" class="anchored"><td class="def field"><a href="#type-t.name" class="anchor"></a><code>name : string;</code></td><td class="doc"><p>The role's name.</p></td></tr><tr id="type-t.colour" class="anchored"><td class="def field"><a href="#type-t.colour" class="anchor"></a><code>colour : int;</code></td><td class="doc"><p>The integer representation of the role colour.</p></td></tr><tr id="type-t.hoist" class="anchored"><td class="def field"><a href="#type-t.hoist" class="anchor"></a><code>hoist : bool;</code></td><td class="doc"><p>Whether the role is hoisted. This property controls whether the role is separated on the sidebar.</p></td></tr><tr id="type-t.position" class="anchored"><td class="def field"><a href="#type-t.position" class="anchor"></a><code>position : int;</code></td><td class="doc"><p>The position of the role. <code>@everyone</code> begins the list at 0.</p></td></tr><tr id="type-t.permissions" class="anchored"><td class="def field"><a href="#type-t.permissions" class="anchor"></a><code>permissions : int;</code></td><td class="doc"><p>The integer representation of the permissions the role has.</p></td></tr><tr id="type-t.managed" class="anchored"><td class="def field"><a href="#type-t.managed" class="anchor"></a><code>managed : bool;</code></td><td class="doc"><p>Whether the guild is managed by an integration.</p></td></tr><tr id="type-t.mentionable" class="anchored"><td class="def field"><a href="#type-t.mentionable" class="anchor"></a><code>mentionable : bool;</code></td><td class="doc"><p>Whether the role can be mentioned.</p></td></tr><tr id="type-t.guild_id" class="anchored"><td class="def field"><a href="#type-t.guild_id" class="anchor"></a><code>guild_id : <a href="../Guild_id_t/index.html#type-t">Disml__.Guild_id_t.t</a>;</code></td><td class="doc"><p>The guild ID this role belongs to.</p></td></tr></table><code>}</code></dt><dd><p>A role object.</p></dd></dl><div><div class="spec include"><div class="doc"><dl><dt class="spec value" id="val-t_of_sexp"><a href="#val-t_of_sexp" class="anchor"></a><code><span class="keyword">val </span>t_of_sexp : Ppx_sexp_conv_lib.Sexp.t <span>-></span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-sexp_of_t"><a href="#val-sexp_of_t" class="anchor"></a><code><span class="keyword">val </span>sexp_of_t : <a href="index.html#type-t">t</a> <span>-></span> Ppx_sexp_conv_lib.Sexp.t</code></dt></dl></div></div></div><dl><dt class="spec value" id="val-to_yojson"><a href="#val-to_yojson" class="anchor"></a><code><span class="keyword">val </span>to_yojson : <a href="index.html#type-t">t</a> <span>-></span> Yojson.Safe.json</code></dt><dt class="spec value" id="val-of_yojson"><a href="#val-of_yojson" class="anchor"></a><code><span class="keyword">val </span>of_yojson : Yojson.Safe.json <span>-></span> <a href="index.html#type-t">t</a> Ppx_deriving_yojson_runtime.error_or</code></dt><dt class="spec value" id="val-of_yojson_exn"><a href="#val-of_yojson_exn" class="anchor"></a><code><span class="keyword">val </span>of_yojson_exn : Yojson.Safe.json <span>-></span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-wrap"><a href="#val-wrap" class="anchor"></a><code><span class="keyword">val </span>wrap : guild_id:<a href="../Snowflake/index.html#type-t">Disml__.Snowflake.t</a> <span>-></span> <a href="index.html#type-role">role</a> <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p>Convenience method to produce <a href="index.html#type-t"><code>t</code></a> from <a href="index.html#type-role"><code>role</code></a> and a snowflake.</p></dd></dl></details></div></div></div><dl><dt class="spec value" id="val-delete"><a href="#val-delete" class="anchor"></a><code><span class="keyword">val </span>delete : <a href="index.html#type-t">t</a> <span>-></span> unit Async.Deferred.Or_error.t</code></dt><dd><p>Deletes the role. This is permanent.</p></dd></dl><dl><dt class="spec value" id="val-allow_mention"><a href="#val-allow_mention" class="anchor"></a><code><span class="keyword">val </span>allow_mention : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a> Async.Deferred.Or_error.t</code></dt><dd><p>Edits the role to allow mentions.</p></dd></dl><dl><dt class="spec value" id="val-disallow_mention"><a href="#val-disallow_mention" class="anchor"></a><code><span class="keyword">val </span>disallow_mention : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a> Async.Deferred.Or_error.t</code></dt><dd><p>Opposite of <a href="index.html#val-allow_mention"><code>allow_mention</code></a></p></dd></dl><dl><dt class="spec value" id="val-hoist"><a href="#val-hoist" class="anchor"></a><code><span class="keyword">val </span>hoist : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a> Async.Deferred.Or_error.t</code></dt><dd><p>Hoists the role. See <a href="index.html#type-t.hoist"><code>Role.t.hoist</code></a>.</p></dd></dl><dl><dt class="spec value" id="val-unhoist"><a href="#val-unhoist" class="anchor"></a><code><span class="keyword">val </span>unhoist : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a> Async.Deferred.Or_error.t</code></dt><dd><p>Opposite of <a href="index.html#type-role.hoist"><code>hoist</code></a>.</p></dd></dl><dl><dt class="spec value" id="val-set_colour"><a href="#val-set_colour" class="anchor"></a><code><span class="keyword">val </span>set_colour : colour:int <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a> Async.Deferred.Or_error.t</code></dt><dd><p>Sets the colour of the role.</p></dd></dl><dl><dt class="spec value" id="val-set_name"><a href="#val-set_name" class="anchor"></a><code><span class="keyword">val </span>set_name : name:string <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a> Async.Deferred.Or_error.t</code></dt><dd><p>Sets the name of the role.</p></dd></dl></div></body></html>
|