5.0.1 & docs

This commit is contained in:
hydrabolt
2015-11-21 15:51:07 +00:00
parent 477c0a3525
commit cbb69edf85
6 changed files with 47 additions and 3 deletions

View File

@@ -7,6 +7,14 @@ Cache
A Cache object extends an Array (so it can be used like a regular array) but introduces helper functions to make it more useful when developing with discord.js. Unlike a regular array, it doesn't care about the instance or prototype of an object, it works purely on properties.
**Examples:**
.. code-block:: js
client.users.get("id", 11238414);
client.channels.getAll("name", "general");
--------
Functions

View File

@@ -5,6 +5,14 @@ ChannelPermissions
ChannelPermissions is used to represent the final permissions of a user in a channel, to see exactly what they are and aren't allowed to do.
**Examples:**
.. code-block:: js
var user_permissions = channel.permissionsOf(user);
var can_mention_everyone = user_permissions.hasPermission("mentionEveryone");
--------
Functions

View File

@@ -7,6 +7,12 @@ The Equality class is used to see if two objects are equal, based on ``object_1.
If any class in Discord extends equality, it means you should never the default equality operands (``==`` & ``===``) as they could potentially be different instances and therefore appear not to be equal. Instead, use ``equalityObject.equals()`` as shown below.
.. code-block:: js
object1.equals(object2); // GOOD ✓
object1 == object2; // BAD ✖
--------
Functions

View File

@@ -51,7 +51,7 @@ Feel free to make any contributions you want, whether it be through creating an
.. toctree::
:maxdepth: 1
:caption: Util Documentation
:caption: Utility Documentation
docs_cache
docs_equality

View File

@@ -20,4 +20,26 @@ Change 1
client.users.get();
client.servers.get();
client.members.get();
client.members.get();
Change 2
--------
.. code-block:: js
// OLD:
client.on("serverNewMember", (member, server) => {
});
// NEW:
client.on("serverNewMember", (server, user) => {
});
Change 3
---------
The Member Class has been removed, meaning you can't use ``member.permissionsIn(channel)``. To get permissions, use ``channel.permissionsOf(user)``.

View File

@@ -1,6 +1,6 @@
{
"name": "discord.js",
"version": "5.0.0",
"version": "5.0.1",
"description": "A way to interface with the Discord API",
"main": "./entrypoint.js",
"scripts": {