+ Fix Typescript
+ Add some websocket event
+ bla bla
This commit is contained in:
March 7th
2022-04-14 21:32:11 +07:00
parent 31f0252f62
commit 7c7fc192ba
12 changed files with 162 additions and 36 deletions

View File

@@ -4,6 +4,7 @@ const User = require('./User');
const DataResolver = require('../util/DataResolver');
const { HypeSquadOptions } = require('../util/Constants');
const { Util } = require('..');
const { Collection } = require('@discordjs/collection');
/**
* Represents the logged in client's Discord user.
@@ -13,6 +14,12 @@ class ClientUser extends User {
_patch(data) {
super._patch(data);
/*
Add: notes
*/
this.notes = new Collection();
// this.messageMentions = new Collection();
if ('verified' in data) {
/**
* Whether or not this account has been verified

View File

@@ -36,7 +36,6 @@ class User extends Base {
this.premiumGuildSince = null;
this.mutualGuilds = new Collection();
this.applications = null;
this.note = null;
this._patch(data);
}
@@ -138,6 +137,14 @@ class User extends Base {
return Relationship[parseInt(i)];
}
/**
* Check note
* @readonly
*/
get note() {
return this.client.user.notes.get(this.id);
}
// Code written by https://github.com/aiko-chan-ai
_ProfilePatch(data) {
if (!data) return;
@@ -188,7 +195,10 @@ class User extends Base {
* @returns {Promise<User>} the user object
*/
async sendFriendRequest() {
return this.client.relationships.sendFriendRequest(this.username, this.discriminator);
return this.client.relationships.sendFriendRequest(
this.username,
this.discriminator,
);
}
/**
* Blocks the user