From 703b56f394b6962731dd63b96b9fc0af99d3ee60 Mon Sep 17 00:00:00 2001 From: hydrabolt Date: Fri, 20 Nov 2015 21:14:35 +0000 Subject: [PATCH] Added role docs --- docs/docs_role.rst | 74 ++++++++++++++++++++++++++++++++++++++++++++++ docs/index.rst | 1 + docs/vars.rst | 1 + 3 files changed, 76 insertions(+) create mode 100644 docs/docs_role.rst diff --git a/docs/docs_role.rst b/docs/docs_role.rst new file mode 100644 index 000000000..2d57c7d8d --- /dev/null +++ b/docs/docs_role.rst @@ -0,0 +1,74 @@ +.. include:: ./vars.rst + +Role +==== + +Represents data for a Server Role. + +----------- + +Attributes +---------- + +-------- + +position +~~~~~~~~ + +`Number`, position of the role when viewing the roles of a server. + +name +~~~~ + +`String`, name of the role. + +managed +~~~~~~~ + +`Boolean`, whether Discord has created the role itself. Currently only used for Twitch integration. + +id +~~ + +`String`, ID of the role. + +hoist +~~~~~ + +`Boolean`, whether the role should be displayed as a separate category in the users section. + +color +~~~~~ + +`Number`, a base 10 colour. Use ``role.colorAsHex()`` to get a hex colour instead. + +server +~~~~~~ + +The Server_ the role belongs to. + +client +~~~~~~ + +The Client_ that cached the role. + +------ + +Functions +--------- + +------- + +serialise() +~~~~~~~~~~~ + +**Aliases:** `serialize` + +Makes an object with the permission names found in `Permission Constants`_ and a boolean value for them. + +hasPermission(permission) +~~~~~~~~~~~~~~~~~~~~~~~~~ + +Sees whether the role has the permission given. + +- **permission** - See `Permission Constants`_ for valid permission names. \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst index ef61dfab8..9ee7c8167 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -38,6 +38,7 @@ Contents: docs_user docs_message docs_invite + docs_role .. toctree:: :maxdepth: 2 diff --git a/docs/vars.rst b/docs/vars.rst index 7de256f44..d5a26cec1 100644 --- a/docs/vars.rst +++ b/docs/vars.rst @@ -10,5 +10,6 @@ .. _Message : ./docs_message.html .. _Invite : ./docs_invite.html .. _Equality : ./docs_equality.html +.. _Role : ./docs_role.html .. _Promises : https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise .. _EventEmitter : https://nodejs.org/api/events.html#events_class_events_eventemitter \ No newline at end of file