feat(Partials): add DMChannel/MessageReaction#fetch() and PartialTypes.REACTION (#3474)

* add DMChannel#fetch() & Action#getChannel({recipients})

* ref for MessageReaction partial

* typings

* add PartialTypes.REACTION

* accommodate for fully removed reactions

* fix incorrect wording and typo

* typings: MessageReaction#count is nullable

* typings: mark MessageReaction#partial as readonly

Co-Authored-By: Vlad Frangu <kingdgrizzle@gmail.com>

* fix(User): fetch dm channel if cached one is partial

* docs: add missing comma

Co-Authored-By: Antonio Román <kyradiscord@gmail.com>

* fix: accomodate for new reactions

* fix: updating existing/new count on _patch

* docs: typo

* for consistency

Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
This commit is contained in:
izexi
2020-01-05 15:45:49 +00:00
committed by SpaceEEC
parent bf31b28ad9
commit 6af0da1043
9 changed files with 82 additions and 15 deletions

View File

@@ -56,7 +56,15 @@ class DMChannel extends Channel {
* @readonly
*/
get partial() {
return !this.recipient;
return typeof this.lastMessageID === 'undefined';
}
/**
* Fetch this DMChannel.
* @returns {Promise<DMChannel>}
*/
fetch() {
return this.recipient.createDM();
}
/**