diff --git a/src/structures/ClientPresence.js b/src/structures/ClientPresence.js index a92dfb302..90db53bd0 100644 --- a/src/structures/ClientPresence.js +++ b/src/structures/ClientPresence.js @@ -6,6 +6,10 @@ const { ActivityTypes, OPCodes } = require('../util/Constants'); const { TypeError } = require('../errors'); class ClientPresence extends Presence { + /** + * @param {Client} client The instantiating client + * @param {Object} [data={}] The data for the client presence + */ constructor(client, data = {}) { super(client, Object.assign(data, { status: 'online', user: { id: null } })); } diff --git a/src/structures/DMChannel.js b/src/structures/DMChannel.js index e58942c3e..e172f2260 100644 --- a/src/structures/DMChannel.js +++ b/src/structures/DMChannel.js @@ -10,6 +10,10 @@ const MessageStore = require('../stores/MessageStore'); * @implements {TextBasedChannel} */ class DMChannel extends Channel { + /** + * @param {Client} client The instantiating client + * @param {Object} data The data for the DM channel + */ constructor(client, data) { super(client, data); // Override the channel type so partials have a known type diff --git a/src/structures/Guild.js b/src/structures/Guild.js index 9c44b1b8c..9aeb30973 100644 --- a/src/structures/Guild.js +++ b/src/structures/Guild.js @@ -26,6 +26,10 @@ const { Error, TypeError } = require('../errors'); * @extends {Base} */ class Guild extends Base { + /** + * @param {Client} client The instantiating client + * @param {Object} data The data for the guild + */ constructor(client, data) { super(client); diff --git a/src/structures/GuildChannel.js b/src/structures/GuildChannel.js index 694fdf02e..4ba8eb99b 100644 --- a/src/structures/GuildChannel.js +++ b/src/structures/GuildChannel.js @@ -14,6 +14,10 @@ const { Error, TypeError } = require('../errors'); * @extends {Channel} */ class GuildChannel extends Channel { + /** + * @param {Guild} guild The guild the guild channel is part of + * @param {Object} data The data for the guild channel + */ constructor(guild, data) { super(guild.client, data); diff --git a/src/structures/GuildEmoji.js b/src/structures/GuildEmoji.js index ff705e591..30c672636 100644 --- a/src/structures/GuildEmoji.js +++ b/src/structures/GuildEmoji.js @@ -10,6 +10,11 @@ const Emoji = require('./Emoji'); * @extends {Emoji} */ class GuildEmoji extends Emoji { + /** + * @param {Client} client The instantiating client + * @param {Object} 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); diff --git a/src/structures/GuildMember.js b/src/structures/GuildMember.js index d479dd772..e0abea443 100644 --- a/src/structures/GuildMember.js +++ b/src/structures/GuildMember.js @@ -15,6 +15,11 @@ const { Error } = require('../errors'); * @extends {Base} */ class GuildMember extends Base { + /** + * @param {Client} client The instantiating client + * @param {Object} data The data for the guild member + * @param {Guild} guild The guild the member is part of + */ constructor(client, data, guild) { super(client); diff --git a/src/structures/Message.js b/src/structures/Message.js index afdb5e2c4..b57f4299e 100644 --- a/src/structures/Message.js +++ b/src/structures/Message.js @@ -19,6 +19,11 @@ const APIMessage = require('./APIMessage'); * @extends {Base} */ class Message extends Base { + /** + * @param {Client} client The instantiating client + * @param {Object} data The data for the message + * @param {TextChannel|DMChannel} channel The channel the message was sent in + */ constructor(client, data, channel) { super(client); diff --git a/src/structures/MessageReaction.js b/src/structures/MessageReaction.js index 69138fda2..fe10e428f 100644 --- a/src/structures/MessageReaction.js +++ b/src/structures/MessageReaction.js @@ -9,6 +9,11 @@ const ReactionUserStore = require('../stores/ReactionUserStore'); * Represents a reaction to a message. */ class MessageReaction { + /** + * @param {Client} client The instantiating client + * @param {Object} data The data for the message reaction + * @param {Message} message The message the reaction refers to + */ constructor(client, data, message) { /** * The message that this reaction refers to diff --git a/src/structures/Presence.js b/src/structures/Presence.js index a2d76bc09..16b4f002c 100644 --- a/src/structures/Presence.js +++ b/src/structures/Presence.js @@ -25,6 +25,10 @@ const { ActivityTypes } = require('../util/Constants'); * Represents a user's presence. */ class Presence { + /** + * @param {Client} client The instantiating client + * @param {Object} [data={}] The data for the presence + */ constructor(client, data = {}) { Object.defineProperty(this, 'client', { value: client }); /** diff --git a/src/structures/Role.js b/src/structures/Role.js index 45b4ed317..ce9f36373 100644 --- a/src/structures/Role.js +++ b/src/structures/Role.js @@ -11,6 +11,11 @@ const { Error, TypeError } = require('../errors'); * @extends {Base} */ class Role extends Base { + /** + * @param {Client} client The instantiating client + * @param {Object} data The data for the role + * @param {Guild} guild The guild the role is part of + */ constructor(client, data, guild) { super(client); diff --git a/src/structures/TextChannel.js b/src/structures/TextChannel.js index a643815e5..e50bee05a 100644 --- a/src/structures/TextChannel.js +++ b/src/structures/TextChannel.js @@ -13,6 +13,10 @@ const MessageStore = require('../stores/MessageStore'); * @implements {TextBasedChannel} */ class TextChannel extends GuildChannel { + /** + * @param {Guild} guild The guild the text channel is part of + * @param {Object} data The data for the text channel + */ constructor(guild, data) { super(guild, data); /** diff --git a/src/structures/User.js b/src/structures/User.js index a0436f7e8..c2276c4f2 100644 --- a/src/structures/User.js +++ b/src/structures/User.js @@ -12,6 +12,10 @@ const { Error } = require('../errors'); * @extends {Base} */ class User extends Base { + /** + * @param {Client} client The instantiating client + * @param {Object} data The data for the user + */ constructor(client, data) { super(client); diff --git a/src/structures/VoiceState.js b/src/structures/VoiceState.js index 9ff71e87a..d74fc6aa0 100644 --- a/src/structures/VoiceState.js +++ b/src/structures/VoiceState.js @@ -6,6 +6,10 @@ const Base = require('./Base'); * Represents the voice state for a Guild Member. */ class VoiceState extends Base { + /** + * @param {Guild} guild The guild the voice state is part of + * @param {Object} data The data for the voice state + */ constructor(guild, data) { super(guild.client); /** diff --git a/typings/index.d.ts b/typings/index.d.ts index 172d0dc82..3ad8789db 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -809,7 +809,7 @@ declare module 'discord.js' { } export class Presence { - constructor(client: Client, data?: object); + constructor(client: Client, data: object); public activity: Activity; public flags: Readonly; public status: PresenceStatus;