v2.1.0
fix: ClientUser.notes return empty Collection fix: Recieve messages from large servers #72 feat: checkUpdate return Debug event (not console.log) feat: RelationshipAdd event, param type return RelationshipTypes feat: online status when login feat: fix documents
This commit is contained in:
@@ -14,17 +14,6 @@ class ClientUser extends User {
|
||||
_patch(data) {
|
||||
super._patch(data);
|
||||
|
||||
/*
|
||||
Add: notes
|
||||
*/
|
||||
/**
|
||||
* The notes cache of the client user.
|
||||
* @type {Collection<Snowflake, Message>}
|
||||
* @private
|
||||
*/
|
||||
this.notes = new Collection();
|
||||
// This.messageMentions = new Collection();
|
||||
|
||||
if ('verified' in data) {
|
||||
/**
|
||||
* Whether or not this account has been verified
|
||||
@@ -67,11 +56,23 @@ class ClientUser extends User {
|
||||
/**
|
||||
* Email address of the client user.
|
||||
* @type {?string}
|
||||
* @deprecated
|
||||
* @see https://discord.com/developers/docs/resources/user#user-object
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Patch note
|
||||
* @param {Object} data Note data
|
||||
* @private
|
||||
*/
|
||||
_patchNote(data) {
|
||||
/**
|
||||
* The notes cache of the client user.
|
||||
* @type {Collection<Snowflake, string>}
|
||||
* @private
|
||||
*/
|
||||
this.notes = data ? new Collection(Object.entries(data)) : new Collection();
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents the client user's presence
|
||||
* @type {ClientPresence}
|
||||
@@ -163,10 +164,10 @@ class ClientUser extends User {
|
||||
/**
|
||||
* Set HyperSquad House
|
||||
* @param {HypeSquadOptions<number|string>} type
|
||||
* `LEAVE`: 0
|
||||
* `HOUSE_BRAVERY`: 1
|
||||
* `HOUSE_BRILLIANCE`: 2
|
||||
* `HOUSE_BALANCE`: 3
|
||||
* * `LEAVE`: 0
|
||||
* * `HOUSE_BRAVERY`: 1
|
||||
* * `HOUSE_BRILLIANCE`: 2
|
||||
* * `HOUSE_BALANCE`: 3
|
||||
* @returns {Promise<void>}
|
||||
* @example
|
||||
* // Set HyperSquad HOUSE_BRAVERY
|
||||
|
@@ -207,7 +207,8 @@ class User extends Base {
|
||||
|
||||
/**
|
||||
* Get profile from Discord, if client is in a server with the target.
|
||||
* @returns {Promise<User>} the user object
|
||||
* @type {User}
|
||||
* @returns {Promise<User>}
|
||||
*/
|
||||
async getProfile() {
|
||||
if (this.client.bot) throw new Error('INVALID_BOT_METHOD');
|
||||
@@ -217,8 +218,9 @@ class User extends Base {
|
||||
}
|
||||
|
||||
/**
|
||||
* Friends the user and send Request [If no request]
|
||||
* @returns {Promise<User>} the user object
|
||||
* Friends the user [If incoming request]
|
||||
* @type {boolean}
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
setFriend() {
|
||||
return this.client.relationships.addFriend(this);
|
||||
@@ -226,14 +228,16 @@ class User extends Base {
|
||||
|
||||
/**
|
||||
* Send Friend Request to the user
|
||||
* @returns {Promise<User>} the user object
|
||||
* @type {boolean}
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
sendFriendRequest() {
|
||||
return this.client.relationships.sendFriendRequest(this.username, this.discriminator);
|
||||
}
|
||||
/**
|
||||
* Blocks the user
|
||||
* @returns {Promise<User>} the user object
|
||||
* @type {boolean}
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
setBlock() {
|
||||
return this.client.relationships.addBlocked(this);
|
||||
@@ -241,7 +245,8 @@ class User extends Base {
|
||||
|
||||
/**
|
||||
* Removes the user from your blocks list
|
||||
* @returns {Promise<User>} the user object
|
||||
* @type {boolean}
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
unBlock() {
|
||||
return this.client.relationships.deleteBlocked(this);
|
||||
@@ -249,7 +254,8 @@ class User extends Base {
|
||||
|
||||
/**
|
||||
* Removes the user from your friends list
|
||||
* @returns {Promise<User>} the user object
|
||||
* @type {boolean}
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
unFriend() {
|
||||
return this.client.relationships.deleteFriend(this);
|
||||
|
Reference in New Issue
Block a user