mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 10:33:30 +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
|
||||||
@@ -4,4 +4,4 @@ exports.IDLE = 0;
|
|||||||
exports.LOGGING_IN = 1;
|
exports.LOGGING_IN = 1;
|
||||||
exports.LOGGED_IN = 2;
|
exports.LOGGED_IN = 2;
|
||||||
exports.READY = 3;
|
exports.READY = 3;
|
||||||
exports.DISCONNECTED = 4;
|
exports.DISCONNECTED = 4;
|
||||||
@@ -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") {
|
||||||
|
|||||||
@@ -127,4 +127,4 @@ var PacketType = {
|
|||||||
exports.API_ENDPOINT = API;
|
exports.API_ENDPOINT = API;
|
||||||
exports.Endpoints = Endpoints;
|
exports.Endpoints = Endpoints;
|
||||||
exports.PacketType = PacketType;
|
exports.PacketType = PacketType;
|
||||||
exports.Permissions = Permissions;
|
exports.Permissions = Permissions;
|
||||||
@@ -27,4 +27,4 @@ var Channel = (function (_Equality) {
|
|||||||
return Channel;
|
return Channel;
|
||||||
})(Equality);
|
})(Equality);
|
||||||
|
|
||||||
module.exports = Channel;
|
module.exports = Channel;
|
||||||
@@ -72,4 +72,4 @@ var ChannelPermissions = (function () {
|
|||||||
return ChannelPermissions;
|
return ChannelPermissions;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
module.exports = ChannelPermissions;
|
module.exports = ChannelPermissions;
|
||||||
@@ -29,4 +29,4 @@ var Invite = (function () {
|
|||||||
return Invite;
|
return Invite;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
module.exports = Invite;
|
module.exports = Invite;
|
||||||
@@ -83,4 +83,4 @@ var PermissionOverwrite = (function () {
|
|||||||
return PermissionOverwrite;
|
return PermissionOverwrite;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
module.exports = PermissionOverwrite;
|
module.exports = PermissionOverwrite;
|
||||||
@@ -136,4 +136,4 @@ var Role = (function () {
|
|||||||
return Role;
|
return Role;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
module.exports = Role;
|
module.exports = Role;
|
||||||
@@ -166,4 +166,4 @@ var Server = (function (_Equality) {
|
|||||||
return Server;
|
return Server;
|
||||||
})(Equality);
|
})(Equality);
|
||||||
|
|
||||||
module.exports = Server;
|
module.exports = Server;
|
||||||
@@ -55,4 +55,4 @@ var User = (function (_Equality) {
|
|||||||
return User;
|
return User;
|
||||||
})(Equality);
|
})(Equality);
|
||||||
|
|
||||||
module.exports = User;
|
module.exports = User;
|
||||||
@@ -18,4 +18,4 @@ var VoiceChannel = (function (_ServerChannel) {
|
|||||||
return VoiceChannel;
|
return VoiceChannel;
|
||||||
})(ServerChannel);
|
})(ServerChannel);
|
||||||
|
|
||||||
module.exports = VoiceChannel;
|
module.exports = VoiceChannel;
|
||||||
@@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
exports.reg = function (c, a) {
|
exports.reg = function (c, a) {
|
||||||
return [c].concat(Array.prototype.slice.call(a));
|
return [c].concat(Array.prototype.slice.call(a));
|
||||||
};
|
};
|
||||||
@@ -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);
|
||||||
|
|||||||
@@ -42,4 +42,4 @@ var Equality = (function () {
|
|||||||
return Equality;
|
return Equality;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
module.exports = Equality;
|
module.exports = Equality;
|
||||||
@@ -126,4 +126,4 @@ var AudioEncoder = (function () {
|
|||||||
return AudioEncoder;
|
return AudioEncoder;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
module.exports = AudioEncoder;
|
module.exports = AudioEncoder;
|
||||||
@@ -19,4 +19,4 @@ var StreamIntent = (function (_EventEmitter) {
|
|||||||
return StreamIntent;
|
return StreamIntent;
|
||||||
})(EventEmitter);
|
})(EventEmitter);
|
||||||
|
|
||||||
module.exports = StreamIntent;
|
module.exports = StreamIntent;
|
||||||
@@ -329,4 +329,4 @@ var VoiceConnection = (function (_EventEmitter) {
|
|||||||
return VoiceConnection;
|
return VoiceConnection;
|
||||||
})(EventEmitter);
|
})(EventEmitter);
|
||||||
|
|
||||||
module.exports = VoiceConnection;
|
module.exports = VoiceConnection;
|
||||||
@@ -23,4 +23,4 @@ var VoicePacket = function VoicePacket(data, sequence, time, ssrc) {
|
|||||||
return returnBuffer;
|
return returnBuffer;
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = VoicePacket;
|
module.exports = VoicePacket;
|
||||||
@@ -14,4 +14,4 @@ module.exports = {
|
|||||||
TextChannel: require("./Structures/TextChannel"),
|
TextChannel: require("./Structures/TextChannel"),
|
||||||
User: require("./Structures/User"),
|
User: require("./Structures/User"),
|
||||||
VoiceChannel: require("./Structures/VoiceChannel")
|
VoiceChannel: require("./Structures/VoiceChannel")
|
||||||
};
|
};
|
||||||
Reference in New Issue
Block a user