refactor(Presences): remove from User, nullable on GuildMember (#6055)

as well as on Client#presenceUpdate
This commit is contained in:
SpaceEEC
2021-07-05 20:53:00 +02:00
committed by GitHub
parent 8d9ab741c8
commit afbd5db404
4 changed files with 5 additions and 28 deletions

View File

@@ -1,7 +1,6 @@
'use strict';
const Base = require('./Base');
const { Presence } = require('./Presence');
const VoiceState = require('./VoiceState');
const TextBasedChannel = require('./interfaces/TextBasedChannel');
const { Error } = require('../errors');
@@ -133,19 +132,11 @@ class GuildMember extends Base {
/**
* The presence of this guild member
* @type {Presence}
* @type {?Presence}
* @readonly
*/
get presence() {
return (
this.guild.presences.cache.get(this.id) ??
new Presence(this.client, {
user: {
id: this.id,
},
guild: this.guild,
})
);
return this.guild.presences.resolve(this.id);
}
/**