mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 18:43:31 +01:00
Updated docs
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -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") {
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user