mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 00:53:31 +01:00
backport: docs improvements
This commit is contained in:
@@ -316,9 +316,7 @@ class ClientUser extends User {
|
||||
* .catch(console.error);
|
||||
* @example
|
||||
* // Fetch mentions from a guild
|
||||
* client.user.fetchMentions({
|
||||
* guild: '222078108977594368'
|
||||
* })
|
||||
* client.user.fetchMentions({ guild: '222078108977594368' })
|
||||
* .then(console.log)
|
||||
* .catch(console.error);
|
||||
*/
|
||||
|
||||
@@ -84,7 +84,7 @@ class Invite {
|
||||
if (data.inviter) {
|
||||
/**
|
||||
* The user who created this invite
|
||||
* @type {User}
|
||||
* @type {?User}
|
||||
*/
|
||||
this.inviter = this.client.dataManager.newUser(data.inviter);
|
||||
}
|
||||
|
||||
@@ -284,6 +284,11 @@ class Role {
|
||||
* role.setPermissions(['KICK_MEMBERS', 'BAN_MEMBERS'])
|
||||
* .then(updated => console.log(`Updated permissions to ${updated.permissions.bitfield}`))
|
||||
* .catch(console.error);
|
||||
* @example
|
||||
* // Remove all permissions from a role
|
||||
* role.setPermissions(0)
|
||||
* .then(updated => console.log(`Updated permissions to ${updated.permissions.bitfield}`))
|
||||
* .catch(console.error);
|
||||
*/
|
||||
setPermissions(permissions, reason) {
|
||||
return this.edit({ permissions }, reason);
|
||||
|
||||
@@ -52,6 +52,11 @@ class TextChannel extends GuildChannel {
|
||||
/**
|
||||
* Fetch all webhooks for the channel.
|
||||
* @returns {Promise<Collection<Snowflake, Webhook>>}
|
||||
* @example
|
||||
* // Fetch webhooks
|
||||
* channel.fetchWebhooks()
|
||||
* .then(hooks => console.log(`This channel has ${hooks.size} hooks`))
|
||||
* .catch(console.error);
|
||||
*/
|
||||
fetchWebhooks() {
|
||||
return this.client.rest.methods.getChannelWebhooks(this);
|
||||
|
||||
@@ -97,7 +97,7 @@ class Collector extends EventEmitter {
|
||||
|
||||
/**
|
||||
* Return a promise that resolves with the next collected element;
|
||||
* rejects with collected elements if the collector finishes without receving a next element
|
||||
* rejects with collected elements if the collector finishes without receiving a next element
|
||||
* @type {Promise}
|
||||
* @readonly
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user