From b6f158fac46fe18fa3bae63fc60ad9dfecfe579d Mon Sep 17 00:00:00 2001 From: hydrabolt Date: Fri, 20 Nov 2015 16:40:26 +0000 Subject: [PATCH] Updated docs --- docs/docs_cache.rst | 2 ++ docs/docs_client.rst | 2 ++ docs/vars.rst | 3 ++- lib/Client/ConnectionState.js | 2 +- lib/Client/InternalClient.js | 2 +- lib/Constants.js | 2 +- lib/Structures/Channel.js | 2 +- lib/Structures/ChannelPermissions.js | 2 +- lib/Structures/Invite.js | 2 +- lib/Structures/PermissionOverwrite.js | 2 +- lib/Structures/Role.js | 2 +- lib/Structures/Server.js | 2 +- lib/Structures/User.js | 2 +- lib/Structures/VoiceChannel.js | 2 +- lib/Util/ArgumentRegulariser.js | 2 +- lib/Util/Cache.js | 2 +- lib/Util/Equality.js | 2 +- lib/Voice/AudioEncoder.js | 2 +- lib/Voice/StreamIntent.js | 2 +- lib/Voice/VoiceConnection.js | 2 +- lib/Voice/VoicePacket.js | 2 +- lib/index.js | 2 +- 22 files changed, 25 insertions(+), 20 deletions(-) diff --git a/docs/docs_cache.rst b/docs/docs_cache.rst index 9b5bb5269..0528f7b1b 100644 --- a/docs/docs_cache.rst +++ b/docs/docs_cache.rst @@ -3,6 +3,8 @@ 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. Functions diff --git a/docs/docs_client.rst b/docs/docs_client.rst index 42b8d7687..7e6b072f4 100644 --- a/docs/docs_client.rst +++ b/docs/docs_client.rst @@ -3,6 +3,8 @@ 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. Attributes diff --git a/docs/vars.rst b/docs/vars.rst index 440225b93..0728a1ea7 100644 --- a/docs/vars.rst +++ b/docs/vars.rst @@ -1,3 +1,4 @@ .. _Client : ./docs_client.html .. _Cache : ./docs_cache.html -.. _Promises : https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise \ No newline at end of file +.. _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 diff --git a/lib/Client/ConnectionState.js b/lib/Client/ConnectionState.js index e0585d77e..86fb95261 100644 --- a/lib/Client/ConnectionState.js +++ b/lib/Client/ConnectionState.js @@ -4,4 +4,4 @@ exports.IDLE = 0; exports.LOGGING_IN = 1; exports.LOGGED_IN = 2; exports.READY = 3; -exports.DISCONNECTED = 4; +exports.DISCONNECTED = 4; \ No newline at end of file diff --git a/lib/Client/InternalClient.js b/lib/Client/InternalClient.js index 6f3193001..cf0a13a08 100644 --- a/lib/Client/InternalClient.js +++ b/lib/Client/InternalClient.js @@ -1389,7 +1389,7 @@ var InternalClient = (function () { if (channel instanceof PMChannel) { //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 { if (channel.server) { if (channel.type === "text") { diff --git a/lib/Constants.js b/lib/Constants.js index bd03f3260..572f3c8f2 100644 --- a/lib/Constants.js +++ b/lib/Constants.js @@ -127,4 +127,4 @@ var PacketType = { exports.API_ENDPOINT = API; exports.Endpoints = Endpoints; exports.PacketType = PacketType; -exports.Permissions = Permissions; +exports.Permissions = Permissions; \ No newline at end of file diff --git a/lib/Structures/Channel.js b/lib/Structures/Channel.js index 1e84d0e96..053bc38ca 100644 --- a/lib/Structures/Channel.js +++ b/lib/Structures/Channel.js @@ -27,4 +27,4 @@ var Channel = (function (_Equality) { return Channel; })(Equality); -module.exports = Channel; +module.exports = Channel; \ No newline at end of file diff --git a/lib/Structures/ChannelPermissions.js b/lib/Structures/ChannelPermissions.js index 0c1b29e93..fe7a039fd 100644 --- a/lib/Structures/ChannelPermissions.js +++ b/lib/Structures/ChannelPermissions.js @@ -72,4 +72,4 @@ var ChannelPermissions = (function () { return ChannelPermissions; })(); -module.exports = ChannelPermissions; +module.exports = ChannelPermissions; \ No newline at end of file diff --git a/lib/Structures/Invite.js b/lib/Structures/Invite.js index dcd7bc5b8..c003ff1dc 100644 --- a/lib/Structures/Invite.js +++ b/lib/Structures/Invite.js @@ -29,4 +29,4 @@ var Invite = (function () { return Invite; })(); -module.exports = Invite; +module.exports = Invite; \ No newline at end of file diff --git a/lib/Structures/PermissionOverwrite.js b/lib/Structures/PermissionOverwrite.js index 99f82bc0b..f20d61b7a 100644 --- a/lib/Structures/PermissionOverwrite.js +++ b/lib/Structures/PermissionOverwrite.js @@ -83,4 +83,4 @@ var PermissionOverwrite = (function () { return PermissionOverwrite; })(); -module.exports = PermissionOverwrite; +module.exports = PermissionOverwrite; \ No newline at end of file diff --git a/lib/Structures/Role.js b/lib/Structures/Role.js index 21e0f2b88..048c183cb 100644 --- a/lib/Structures/Role.js +++ b/lib/Structures/Role.js @@ -136,4 +136,4 @@ var Role = (function () { return Role; })(); -module.exports = Role; +module.exports = Role; \ No newline at end of file diff --git a/lib/Structures/Server.js b/lib/Structures/Server.js index a43875b2b..99ee3971a 100644 --- a/lib/Structures/Server.js +++ b/lib/Structures/Server.js @@ -166,4 +166,4 @@ var Server = (function (_Equality) { return Server; })(Equality); -module.exports = Server; +module.exports = Server; \ No newline at end of file diff --git a/lib/Structures/User.js b/lib/Structures/User.js index 12260a051..3815089ee 100644 --- a/lib/Structures/User.js +++ b/lib/Structures/User.js @@ -55,4 +55,4 @@ var User = (function (_Equality) { return User; })(Equality); -module.exports = User; +module.exports = User; \ No newline at end of file diff --git a/lib/Structures/VoiceChannel.js b/lib/Structures/VoiceChannel.js index b61a9082e..333786b58 100644 --- a/lib/Structures/VoiceChannel.js +++ b/lib/Structures/VoiceChannel.js @@ -18,4 +18,4 @@ var VoiceChannel = (function (_ServerChannel) { return VoiceChannel; })(ServerChannel); -module.exports = VoiceChannel; +module.exports = VoiceChannel; \ No newline at end of file diff --git a/lib/Util/ArgumentRegulariser.js b/lib/Util/ArgumentRegulariser.js index 1ffbee29a..9c98ddb39 100644 --- a/lib/Util/ArgumentRegulariser.js +++ b/lib/Util/ArgumentRegulariser.js @@ -2,4 +2,4 @@ exports.reg = function (c, a) { return [c].concat(Array.prototype.slice.call(a)); -}; +}; \ No newline at end of file diff --git a/lib/Util/Cache.js b/lib/Util/Cache.js index 3bdf3477d..b0d5f51c0 100644 --- a/lib/Util/Cache.js +++ b/lib/Util/Cache.js @@ -30,7 +30,7 @@ var Cache = (function (_Array) { }; Cache.prototype.getAll = function getAll(key, value) { - var found = []; + var found = new Cache(this.discrim); this.forEach(function (val, index, array) { if (val.hasOwnProperty(key) && val[key] == value) { found.push(val); diff --git a/lib/Util/Equality.js b/lib/Util/Equality.js index dd5763f74..3288d530a 100644 --- a/lib/Util/Equality.js +++ b/lib/Util/Equality.js @@ -42,4 +42,4 @@ var Equality = (function () { return Equality; })(); -module.exports = Equality; +module.exports = Equality; \ No newline at end of file diff --git a/lib/Voice/AudioEncoder.js b/lib/Voice/AudioEncoder.js index f178f9e2b..517a7cf68 100644 --- a/lib/Voice/AudioEncoder.js +++ b/lib/Voice/AudioEncoder.js @@ -126,4 +126,4 @@ var AudioEncoder = (function () { return AudioEncoder; })(); -module.exports = AudioEncoder; +module.exports = AudioEncoder; \ No newline at end of file diff --git a/lib/Voice/StreamIntent.js b/lib/Voice/StreamIntent.js index aa6bb38c4..97953194c 100644 --- a/lib/Voice/StreamIntent.js +++ b/lib/Voice/StreamIntent.js @@ -19,4 +19,4 @@ var StreamIntent = (function (_EventEmitter) { return StreamIntent; })(EventEmitter); -module.exports = StreamIntent; +module.exports = StreamIntent; \ No newline at end of file diff --git a/lib/Voice/VoiceConnection.js b/lib/Voice/VoiceConnection.js index f61b002f6..4dee53b15 100644 --- a/lib/Voice/VoiceConnection.js +++ b/lib/Voice/VoiceConnection.js @@ -329,4 +329,4 @@ var VoiceConnection = (function (_EventEmitter) { return VoiceConnection; })(EventEmitter); -module.exports = VoiceConnection; +module.exports = VoiceConnection; \ No newline at end of file diff --git a/lib/Voice/VoicePacket.js b/lib/Voice/VoicePacket.js index 46797646a..f432bf241 100644 --- a/lib/Voice/VoicePacket.js +++ b/lib/Voice/VoicePacket.js @@ -23,4 +23,4 @@ var VoicePacket = function VoicePacket(data, sequence, time, ssrc) { return returnBuffer; }; -module.exports = VoicePacket; +module.exports = VoicePacket; \ No newline at end of file diff --git a/lib/index.js b/lib/index.js index b122e469d..31c91c19c 100644 --- a/lib/index.js +++ b/lib/index.js @@ -14,4 +14,4 @@ module.exports = { TextChannel: require("./Structures/TextChannel"), User: require("./Structures/User"), VoiceChannel: require("./Structures/VoiceChannel") -}; +}; \ No newline at end of file