mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
docs: undocument private constructors (#6732)
This commit is contained in:
@@ -14,11 +14,6 @@ const DataResolver = require('../util/DataResolver');
|
||||
* @implements {TextBasedChannel}
|
||||
*/
|
||||
class BaseGuildTextChannel extends GuildChannel {
|
||||
/**
|
||||
* @param {Guild} guild The guild the text channel is part of
|
||||
* @param {APIChannel} data The data for the text channel
|
||||
* @param {Client} [client] A safety parameter for the client that instantiated this
|
||||
*/
|
||||
constructor(guild, data, client) {
|
||||
super(guild, data, client, false);
|
||||
|
||||
|
||||
@@ -9,10 +9,6 @@ const { ActivityTypes, Opcodes } = require('../util/Constants');
|
||||
* @extends {Presence}
|
||||
*/
|
||||
class ClientPresence extends Presence {
|
||||
/**
|
||||
* @param {Client} client The instantiating client
|
||||
* @param {APIPresence} [data={}] The data for the client presence
|
||||
*/
|
||||
constructor(client, data = {}) {
|
||||
super(client, Object.assign(data, { status: data.status ?? 'online', user: { id: null } }));
|
||||
}
|
||||
@@ -76,3 +72,9 @@ class ClientPresence extends Presence {
|
||||
}
|
||||
|
||||
module.exports = ClientPresence;
|
||||
|
||||
/* eslint-disable max-len */
|
||||
/**
|
||||
* @external APIPresence
|
||||
* @see {@link https://discord.com/developers/docs/rich-presence/how-to#updating-presence-update-presence-payload-fields}
|
||||
*/
|
||||
|
||||
@@ -10,10 +10,6 @@ const MessageManager = require('../managers/MessageManager');
|
||||
* @implements {TextBasedChannel}
|
||||
*/
|
||||
class DMChannel extends Channel {
|
||||
/**
|
||||
* @param {Client} client The instantiating client
|
||||
* @param {APIChannel} data The data for the DM channel
|
||||
*/
|
||||
constructor(client, data) {
|
||||
super(client, data);
|
||||
|
||||
|
||||
@@ -132,11 +132,6 @@ class Guild extends AnonymousGuild {
|
||||
return this.client.ws.shards.get(this.shardId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets up the guild.
|
||||
* @param {*} data The raw data of the guild
|
||||
* @private
|
||||
*/
|
||||
_patch(data) {
|
||||
super._patch(data);
|
||||
this.id = data.id;
|
||||
|
||||
@@ -7,11 +7,6 @@ const Base = require('./Base');
|
||||
* @extends {Base}
|
||||
*/
|
||||
class GuildBan extends Base {
|
||||
/**
|
||||
* @param {Client} client The instantiating client
|
||||
* @param {APIBanData} data The data for the ban
|
||||
* @param {Guild} guild The guild in which the ban is
|
||||
*/
|
||||
constructor(client, data, guild) {
|
||||
super(client);
|
||||
|
||||
@@ -62,8 +57,3 @@ class GuildBan extends Base {
|
||||
}
|
||||
|
||||
module.exports = GuildBan;
|
||||
|
||||
/**
|
||||
* @external APIBanData
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#create-guild-ban-json-params}
|
||||
*/
|
||||
|
||||
@@ -20,12 +20,6 @@ const Util = require('../util/Util');
|
||||
* @abstract
|
||||
*/
|
||||
class GuildChannel extends Channel {
|
||||
/**
|
||||
* @param {Guild} guild The guild the guild channel is part of
|
||||
* @param {APIChannel} data The data for the guild channel
|
||||
* @param {Client} [client] A safety parameter for the client that instantiated this
|
||||
* @param {boolean} [immediatePatch=true] Control variable for patching
|
||||
*/
|
||||
constructor(guild, data, client, immediatePatch = true) {
|
||||
super(guild?.client ?? client, data, false);
|
||||
|
||||
|
||||
@@ -10,11 +10,6 @@ const Permissions = require('../util/Permissions');
|
||||
* @extends {BaseGuildEmoji}
|
||||
*/
|
||||
class GuildEmoji extends BaseGuildEmoji {
|
||||
/**
|
||||
* @param {Client} client The instantiating client
|
||||
* @param {APIEmoji} data The data for the guild emoji
|
||||
* @param {Guild} guild The guild the guild emoji is part of
|
||||
*/
|
||||
constructor(client, data, guild) {
|
||||
super(client, data, guild);
|
||||
|
||||
|
||||
@@ -13,11 +13,6 @@ const Permissions = require('../util/Permissions');
|
||||
* @extends {Base}
|
||||
*/
|
||||
class GuildMember extends Base {
|
||||
/**
|
||||
* @param {Client} client The instantiating client
|
||||
* @param {APIGuildMember} data The data for the guild member
|
||||
* @param {Guild} guild The guild the member is part of
|
||||
*/
|
||||
constructor(client, data, guild) {
|
||||
super(client);
|
||||
|
||||
|
||||
@@ -18,11 +18,6 @@ class GuildPreview extends Base {
|
||||
this._patch(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the guild with the provided data.
|
||||
* @param {*} data The raw data of the guild
|
||||
* @private
|
||||
*/
|
||||
_patch(data) {
|
||||
/**
|
||||
* The id of this guild
|
||||
|
||||
@@ -9,21 +9,11 @@ const DataResolver = require('../util/DataResolver');
|
||||
* @extends {Base}
|
||||
*/
|
||||
class GuildTemplate extends Base {
|
||||
/**
|
||||
* @param {Client} client The instantiating client
|
||||
* @param {APIGuildTemplate} data The raw data for the template
|
||||
*/
|
||||
constructor(client, data) {
|
||||
super(client);
|
||||
this._patch(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds or updates the template with the provided data.
|
||||
* @param {APIGuildTemplate} data The raw data for the template
|
||||
* @returns {GuildTemplate}
|
||||
* @private
|
||||
*/
|
||||
_patch(data) {
|
||||
if ('code' in data) {
|
||||
/**
|
||||
@@ -243,9 +233,3 @@ class GuildTemplate extends Base {
|
||||
GuildTemplate.GUILD_TEMPLATES_PATTERN = /discord(?:app)?\.(?:com\/template|new)\/([\w-]{2,255})/gi;
|
||||
|
||||
module.exports = GuildTemplate;
|
||||
|
||||
/* eslint-disable max-len */
|
||||
/**
|
||||
* @external APIGuildTemplate
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild-template#guild-template-object-guild-template-structure}
|
||||
*/
|
||||
|
||||
@@ -24,10 +24,6 @@ const Util = require('../util/Util');
|
||||
* @extends {Base}
|
||||
*/
|
||||
class Message extends Base {
|
||||
/**
|
||||
* @param {Client} client The instantiating client
|
||||
* @param {APIMessage} data The data for the message
|
||||
*/
|
||||
constructor(client, data) {
|
||||
super(client);
|
||||
|
||||
|
||||
@@ -9,11 +9,6 @@ const Util = require('../util/Util');
|
||||
* Represents a reaction to a message.
|
||||
*/
|
||||
class MessageReaction {
|
||||
/**
|
||||
* @param {Client} client The instantiating client
|
||||
* @param {APIReaction} data The data for the message reaction
|
||||
* @param {Message} message The message the reaction refers to
|
||||
*/
|
||||
constructor(client, data, message) {
|
||||
/**
|
||||
* The client that instantiated this message reaction
|
||||
@@ -134,8 +129,3 @@ class MessageReaction {
|
||||
}
|
||||
|
||||
module.exports = MessageReaction;
|
||||
|
||||
/**
|
||||
* @external APIReaction
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#reaction-object}
|
||||
*/
|
||||
|
||||
@@ -35,10 +35,6 @@ const Util = require('../util/Util');
|
||||
* @extends {Base}
|
||||
*/
|
||||
class Presence extends Base {
|
||||
/**
|
||||
* @param {Client} client The instantiating client
|
||||
* @param {APIPresence} [data={}] The data for the presence
|
||||
*/
|
||||
constructor(client, data = {}) {
|
||||
super(client);
|
||||
|
||||
@@ -386,9 +382,3 @@ class RichPresenceAssets {
|
||||
exports.Presence = Presence;
|
||||
exports.Activity = Activity;
|
||||
exports.RichPresenceAssets = RichPresenceAssets;
|
||||
|
||||
/* eslint-disable max-len */
|
||||
/**
|
||||
* @external APIPresence
|
||||
* @see {@link https://discord.com/developers/docs/rich-presence/how-to#updating-presence-update-presence-payload-fields}
|
||||
*/
|
||||
|
||||
@@ -11,11 +11,6 @@ const Util = require('../util/Util');
|
||||
* @extends {Base}
|
||||
*/
|
||||
class Role extends Base {
|
||||
/**
|
||||
* @param {Client} client The instantiating client
|
||||
* @param {APIRole} data The data for the role
|
||||
* @param {Guild} guild The guild the role is part of
|
||||
*/
|
||||
constructor(client, data, guild) {
|
||||
super(client);
|
||||
|
||||
|
||||
@@ -9,10 +9,6 @@ const SnowflakeUtil = require('../util/SnowflakeUtil');
|
||||
* @extends {Base}
|
||||
*/
|
||||
class Sticker extends Base {
|
||||
/**
|
||||
* @param {Client} client The instantiating client
|
||||
* @param {APISticker | APIStickerItem} sticker The data for the sticker
|
||||
*/
|
||||
constructor(client, sticker) {
|
||||
super(client);
|
||||
|
||||
@@ -274,8 +270,3 @@ module.exports = Sticker;
|
||||
* @external APISticker
|
||||
* @see {@link https://discord.com/developers/docs/resources/sticker#sticker-object}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @external APIStickerItem
|
||||
* @see {@link https://discord.com/developers/docs/resources/sticker#sticker-item-object}
|
||||
*/
|
||||
|
||||
@@ -10,10 +10,6 @@ const SnowflakeUtil = require('../util/SnowflakeUtil');
|
||||
* @extends {Base}
|
||||
*/
|
||||
class StickerPack extends Base {
|
||||
/**
|
||||
* @param {Client} client The instantiating client
|
||||
* @param {APIStickerPack} pack The data for the sticker pack
|
||||
*/
|
||||
constructor(client, pack) {
|
||||
super(client);
|
||||
/**
|
||||
@@ -97,8 +93,3 @@ class StickerPack extends Base {
|
||||
}
|
||||
|
||||
module.exports = StickerPack;
|
||||
|
||||
/**
|
||||
* @external APIStickerPack
|
||||
* @see {@link https://discord.com/developers/docs/resources/sticker#sticker-pack-object}
|
||||
*/
|
||||
|
||||
@@ -7,11 +7,6 @@ const GuildChannel = require('./GuildChannel');
|
||||
* @extends {GuildChannel}
|
||||
*/
|
||||
class StoreChannel extends GuildChannel {
|
||||
/**
|
||||
* @param {Guild} guild The guild the store channel is part of
|
||||
* @param {APIChannel} data The data for the store channel
|
||||
* @param {Client} [client] A safety parameter for the client that instantiated this
|
||||
*/
|
||||
constructor(guild, data, client) {
|
||||
super(guild, data, client);
|
||||
|
||||
|
||||
@@ -13,12 +13,6 @@ const Permissions = require('../util/Permissions');
|
||||
* @implements {TextBasedChannel}
|
||||
*/
|
||||
class ThreadChannel extends Channel {
|
||||
/**
|
||||
* @param {Guild} guild The guild the thread channel is part of
|
||||
* @param {APIChannel} data The data for the thread channel
|
||||
* @param {Client} [client] A safety parameter for the client that instantiated this
|
||||
* @param {boolean} [fromInteraction=false] Whether the data was from an interaction (partial)
|
||||
*/
|
||||
constructor(guild, data, client, fromInteraction = false) {
|
||||
super(guild?.client ?? client, data, false);
|
||||
|
||||
|
||||
@@ -8,10 +8,6 @@ const ThreadMemberFlags = require('../util/ThreadMemberFlags');
|
||||
* @extends {Base}
|
||||
*/
|
||||
class ThreadMember extends Base {
|
||||
/**
|
||||
* @param {ThreadChannel} thread The thread that this member is associated with
|
||||
* @param {APIThreadMember} data The data for the thread member
|
||||
*/
|
||||
constructor(thread, data) {
|
||||
super(thread.client);
|
||||
|
||||
@@ -96,8 +92,3 @@ class ThreadMember extends Base {
|
||||
}
|
||||
|
||||
module.exports = ThreadMember;
|
||||
|
||||
/**
|
||||
* @external APIThreadMember
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#thread-member-object}
|
||||
*/
|
||||
|
||||
@@ -7,11 +7,6 @@ const Base = require('./Base');
|
||||
* @extends {Base}
|
||||
*/
|
||||
class Typing extends Base {
|
||||
/**
|
||||
* @param {TextBasedChannels} channel The channel this typing came from
|
||||
* @param {User} user The user that started typing
|
||||
* @param {APITypingStart} data The raw data received
|
||||
*/
|
||||
constructor(channel, user, data) {
|
||||
super(channel.client);
|
||||
|
||||
@@ -77,8 +72,3 @@ class Typing extends Base {
|
||||
}
|
||||
|
||||
module.exports = Typing;
|
||||
|
||||
/**
|
||||
* @external APITypingStart
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway#typing-start-typing-start-event-fields}
|
||||
*/
|
||||
|
||||
@@ -12,10 +12,6 @@ const UserFlags = require('../util/UserFlags');
|
||||
* @extends {Base}
|
||||
*/
|
||||
class User extends Base {
|
||||
/**
|
||||
* @param {Client} client The instantiating client
|
||||
* @param {APIUser} data The data for the user
|
||||
*/
|
||||
constructor(client, data) {
|
||||
super(client);
|
||||
|
||||
|
||||
@@ -7,10 +7,6 @@ const { Error, TypeError } = require('../errors');
|
||||
* Represents the voice state for a Guild Member.
|
||||
*/
|
||||
class VoiceState extends Base {
|
||||
/**
|
||||
* @param {Guild} guild The guild the voice state is part of
|
||||
* @param {APIVoiceState} data The data for the voice state
|
||||
*/
|
||||
constructor(guild, data) {
|
||||
super(guild.client);
|
||||
/**
|
||||
@@ -275,8 +271,3 @@ class VoiceState extends Base {
|
||||
}
|
||||
|
||||
module.exports = VoiceState;
|
||||
|
||||
/**
|
||||
* @external APIVoiceState
|
||||
* @see {@link https://discord.com/developers/docs/resources/voice#voice-state-object}
|
||||
*/
|
||||
|
||||
@@ -8,10 +8,6 @@ const WidgetMember = require('./WidgetMember');
|
||||
* Represents a Widget.
|
||||
*/
|
||||
class Widget extends Base {
|
||||
/**
|
||||
* @param {Client} client The instantiating client
|
||||
* @param {Object} data The raw data
|
||||
*/
|
||||
constructor(client, data) {
|
||||
super(client);
|
||||
this._patch(data);
|
||||
@@ -25,11 +21,6 @@ class Widget extends Base {
|
||||
* @property {number} position Position of the channel
|
||||
*/
|
||||
|
||||
/**
|
||||
* Builds the widget with the provided data.
|
||||
* @param {*} data The raw data of the widget
|
||||
* @private
|
||||
*/
|
||||
_patch(data) {
|
||||
/**
|
||||
* The id of the guild.
|
||||
|
||||
@@ -12,10 +12,6 @@ class WidgetMember extends Base {
|
||||
* @property {string} name The name of the activity
|
||||
*/
|
||||
|
||||
/**
|
||||
* @param {Client} client The instantiating client
|
||||
* @param {Object} data The raw data
|
||||
*/
|
||||
constructor(client, data) {
|
||||
super(client);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user