Files
discord.js/src/structures/WidgetMember.js
Antonio Román a7c6678c72 refactor: change xID to xId (#6036)
* refactor: change `xID` to `xId`

* Update src/managers/MessageManager.js

Co-authored-by: Noel <buechler.noel@outlook.com>

Co-authored-by: Noel <buechler.noel@outlook.com>
2021-07-04 19:54:27 +01:00

103 lines
1.9 KiB
JavaScript

'use strict';
const Base = require('./Base');
/**
* Represents a WidgetMember.
*/
class WidgetMember extends Base {
/**
* Activity sent in a {@link WidgetMember}.
* @typedef {Object} WidgetActivity
* @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);
/**
* The id of the user. It's an arbitrary number.
* @type {string}
*/
this.id = data.id;
/**
* The username of the member.
* @type {string}
*/
this.username = data.username;
/**
* The discriminator of the member.
* @type {string}
*/
this.discriminator = data.discriminator;
/**
* The avatar of the member.
* @type {?string}
*/
this.avatar = data.avatar;
/**
* The status of the member.
* @type {PresenceStatus}
*/
this.status = data.status;
/**
* IIf the member is server deafened
* @type {?boolean}
*/
this.deaf = data.deaf;
/**
* If the member is server muted
* @type {?boolean}
*/
this.mute = data.mute;
/**
* If the member is self deafened
* @type {?boolean}
*/
this.selfDeaf = data.self_deaf;
/**
* If the member is self muted
* @type {?boolean}
*/
this.selfMute = data.self_mute;
/**
* If the member is suppressed
* @type {?boolean}
*/
this.suppress = data.suppress;
/**
* The id of the voice channel the member is in, if any
* @type {?Snowflake}
*/
this.channelId = data.channel_id;
/**
* The avatar URL of the member.
* @type {string}
*/
this.avatarURL = data.avatar_url;
/**
* The activity of the member.
* @type {?WidgetActivity}
*/
this.activity = data.activity;
}
}
module.exports = WidgetMember;