mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 09:33:32 +01:00
Docs cleanup
This commit is contained in:
@@ -69,9 +69,11 @@ class Shard {
|
||||
* @param {string} prop Name of the client property to get, using periods for nesting
|
||||
* @returns {Promise<*>}
|
||||
* @example
|
||||
* shard.fetchClientValue('guilds.size').then(count => {
|
||||
* console.log(`${count} guilds in shard ${shard.id}`);
|
||||
* }).catch(console.error);
|
||||
* shard.fetchClientValue('guilds.size')
|
||||
* .then(count => {
|
||||
* console.log(`${count} guilds in shard ${shard.id}`);
|
||||
* })
|
||||
* .catch(console.error);
|
||||
*/
|
||||
fetchClientValue(prop) {
|
||||
if (this._fetches.has(prop)) return this._fetches.get(prop);
|
||||
|
||||
@@ -49,9 +49,11 @@ class ShardClientUtil {
|
||||
* @param {string} prop Name of the client property to get, using periods for nesting
|
||||
* @returns {Promise<Array>}
|
||||
* @example
|
||||
* client.shard.fetchClientValues('guilds.size').then(results => {
|
||||
* console.log(`${results.reduce((prev, val) => prev + val, 0)} total guilds`);
|
||||
* }).catch(console.error);
|
||||
* client.shard.fetchClientValues('guilds.size')
|
||||
* .then(results => {
|
||||
* console.log(`${results.reduce((prev, val) => prev + val, 0)} total guilds`);
|
||||
* })
|
||||
* .catch(console.error);
|
||||
*/
|
||||
fetchClientValues(prop) {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
@@ -176,9 +176,11 @@ class ShardingManager extends EventEmitter {
|
||||
* @param {string} prop Name of the client property to get, using periods for nesting
|
||||
* @returns {Promise<Array>}
|
||||
* @example
|
||||
* manager.fetchClientValues('guilds.size').then(results => {
|
||||
* console.log(`${results.reduce((prev, val) => prev + val, 0)} total guilds`);
|
||||
* }).catch(console.error);
|
||||
* manager.fetchClientValues('guilds.size')
|
||||
* .then(results => {
|
||||
* console.log(`${results.reduce((prev, val) => prev + val, 0)} total guilds`);
|
||||
* })
|
||||
* .catch(console.error);
|
||||
*/
|
||||
fetchClientValues(prop) {
|
||||
if (this.shards.size === 0) return Promise.reject(new Error('No shards have been spawned.'));
|
||||
|
||||
Reference in New Issue
Block a user