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 TextBasedChannel = require('./interfaces/TextBasedChannel');
const { Error } = require('../errors');
const SnowflakeUtil = require('../util/SnowflakeUtil');
@@ -122,18 +121,6 @@ class User extends Base {
return new Date(this.createdTimestamp);
}
/**
* The presence of this user
* @type {Presence}
* @readonly
*/
get presence() {
for (const guild of this.client.guilds.cache.values()) {
if (guild.presences.cache.has(this.id)) return guild.presences.cache.get(this.id);
}
return new Presence(this.client, { user: { id: this.id } });
}
/**
* A link to the user's avatar.
* @param {ImageURLOptions} [options={}] Options for the Image URL