types(Partial): add partial reactions (#6066)

Co-authored-by: Noel <buechler.noel@outlook.com>
This commit is contained in:
DTrombett
2021-07-09 13:25:59 +02:00
committed by GitHub
parent 5b6be0cebc
commit d6c43a50bd
6 changed files with 65 additions and 98 deletions

View File

@@ -63,6 +63,16 @@ class Channel extends Base {
return new Date(this.createdTimestamp);
}
/**
* Whether this Channel is a partial
* <info>This is always false outside of DM channels.</info>
* @type {boolean}
* @readonly
*/
get partial() {
return false;
}
/**
* When concatenated with a string, this automatically returns the channel's mention instead of the Channel object.
* @returns {string}

View File

@@ -16,8 +16,10 @@ class DMChannel extends Channel {
*/
constructor(client, data) {
super(client, data);
// Override the channel type so partials have a known type
this.type = 'DM';
/**
* A manager of the messages belonging to this channel
* @type {MessageManager}

View File

@@ -65,7 +65,7 @@ class GuildMember extends Base {
if ('user' in data) {
/**
* The user that this guild member instance represents
* @type {User}
* @type {?User}
*/
this.user = this.client.users._add(data.user, true);
}

View File

@@ -388,7 +388,7 @@ class Message extends Base {
/**
* The message contents with all mentions replaced by the equivalent text.
* If mentions cannot be resolved to a name, the relevant mention in the message content will not be converted.
* @type {string}
* @type {?string}
* @readonly
*/
get cleanContent() {