Updated docs

This commit is contained in:
hydrabolt
2015-11-20 16:40:26 +00:00
parent 10ea6a9336
commit b6f158fac4
22 changed files with 25 additions and 20 deletions

View File

@@ -3,6 +3,8 @@
Cache Cache
===== =====
**extends Array**
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. 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.
Functions Functions

View File

@@ -3,6 +3,8 @@
Client Client
====== ======
**extends EventEmitter_**
This page contains documentation on the `Discord.Client` class. This should be used when you want to start creating things with the API. This page contains documentation on the `Discord.Client` class. This should be used when you want to start creating things with the API.
Attributes Attributes

View File

@@ -1,3 +1,4 @@
.. _Client : ./docs_client.html .. _Client : ./docs_client.html
.. _Cache : ./docs_cache.html .. _Cache : ./docs_cache.html
.. _Promises : https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise .. _Promises : https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise
.. _EventEmitter : https://nodejs.org/api/events.html#events_class_events_eventemitter

View File

@@ -1389,7 +1389,7 @@ var InternalClient = (function () {
if (channel instanceof PMChannel) { if (channel instanceof PMChannel) {
//PM CHANNEL //PM CHANNEL
client.emit("channelUpdated", self.private_channels.update(channel, new PMChannel(data, client))); client.emit("channelUpdated", channel, self.private_channels.update(channel, new PMChannel(data, client)));
} else { } else {
if (channel.server) { if (channel.server) {
if (channel.type === "text") { if (channel.type === "text") {

View File

@@ -30,7 +30,7 @@ var Cache = (function (_Array) {
}; };
Cache.prototype.getAll = function getAll(key, value) { Cache.prototype.getAll = function getAll(key, value) {
var found = []; var found = new Cache(this.discrim);
this.forEach(function (val, index, array) { this.forEach(function (val, index, array) {
if (val.hasOwnProperty(key) && val[key] == value) { if (val.hasOwnProperty(key) && val[key] == value) {
found.push(val); found.push(val);