mirror of
https://github.com/danbulant/discord.js
synced 2026-06-09 17:52:55 +00:00
Fix presences, damn it hydra
This commit is contained in:
parent
62cfa10ac5
commit
1fc9676ba5
2 changed files with 5 additions and 2 deletions
|
|
@ -3,6 +3,7 @@ const Role = require('./Role');
|
||||||
const EvaluatedPermissions = require('./EvaluatedPermissions');
|
const EvaluatedPermissions = require('./EvaluatedPermissions');
|
||||||
const Constants = require('../util/Constants');
|
const Constants = require('../util/Constants');
|
||||||
const Collection = require('../util/Collection');
|
const Collection = require('../util/Collection');
|
||||||
|
const Presence = require('./Presence').Presence;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a Member of a Guild on Discord
|
* Represents a Member of a Guild on Discord
|
||||||
|
|
@ -107,7 +108,7 @@ class GuildMember {
|
||||||
* @readonly
|
* @readonly
|
||||||
*/
|
*/
|
||||||
get presence() {
|
get presence() {
|
||||||
return this.frozenPresence || this.guild.presences.get(this.id);
|
return this.frozenPresence || this.guild.presences.get(this.id) || new Presence();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,9 @@
|
||||||
*/
|
*/
|
||||||
class Presence {
|
class Presence {
|
||||||
constructor(data) {
|
constructor(data) {
|
||||||
if (!data) return;
|
if (!data) {
|
||||||
|
data = {};
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* The status of the presence:
|
* The status of the presence:
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue