Skip to content

Presence on User #5248

Closed Answered by MattIPv4
almostSouji asked this question in Q&A
Discussion options

You must be logged in to vote

Seems it is just a glorified helper getter to get the presence from the first guild that has the presence.

/**
* 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);
}
if (!Structures) Structures = require('../util/Structures');
const Presence = Structures.get('Presence');
return new Presence(this.client, { user: { id: this.id } });
}

Seems like a sensible bit of cruft to remove given i…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Jiralite
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants