diff --git a/docs/docs_cache.rst b/docs/docs_cache.rst index e908b99bb..184075dbb 100644 --- a/docs/docs_cache.rst +++ b/docs/docs_cache.rst @@ -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 diff --git a/docs/docs_channelpermissions.rst b/docs/docs_channelpermissions.rst index 66788aede..505b7cc2a 100644 --- a/docs/docs_channelpermissions.rst +++ b/docs/docs_channelpermissions.rst @@ -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 diff --git a/docs/docs_equality.rst b/docs/docs_equality.rst index fdd0e39a4..1f45f1d85 100644 --- a/docs/docs_equality.rst +++ b/docs/docs_equality.rst @@ -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 diff --git a/docs/index.rst b/docs/index.rst index 0b4fa91ee..0d3fdf7a7 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -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 diff --git a/docs/migrating.rst b/docs/migrating.rst index 30129f856..9a11a32bf 100644 --- a/docs/migrating.rst +++ b/docs/migrating.rst @@ -20,4 +20,26 @@ Change 1 client.users.get(); client.servers.get(); - client.members.get(); \ No newline at end of file + 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)``. \ No newline at end of file diff --git a/package.json b/package.json index 423849dda..6d90f45c7 100644 --- a/package.json +++ b/package.json @@ -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": {